@RapidJames Thanks for reaching out, The authorize url https://login.microsoftonline.com/common/oauth2/authorize will provide the refresh token and it gets redirect to token endpoint https://login.microsoftonline.com/{Tenant id}/oauth2/token to get the bearer token.
please find the sample curl command below to fetch the bearer token to call the rest api's.
provide the client id, client secret accordingly
curl --location --request POST 'https://login.microsoftonline.com/{Tenant id}/oauth2/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Cookie: buid=0.ARoAv4j5cvGGr0GRqy180BHbR1m5UcQoBoBDr_2HE2393hMaAAA.AQABAAEAAAD--DLA3VO7QrddgJg7Wevrp1BuXyTtIceV0cVvUsX3XKuTcfl-2PAd2pPZJXdJlOldWOlRbQqBVQ2nfTsWC5otMhFCOl0508uw2C4J1aLfpJXxLjK6cWDKDrAy6fneInQgAA; esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevr6LQosMsDuwEVGWro_cPd1IFZwgM08OlG_t20yFRLJGG4pQ_AcFDIFI18jv16nvtgMI0lQw4bec1ZB9Xa2Bz6D1O87BgZ5CjLA1RBj9wnIRtc5nRRmgWRvaWGhlVAwtfr71oB3VgDmpfBOEMROdYOpmfP1RTgVMdhUBqFOI2A3RIgAA; fpc=ArX3vpYIIelCocVLKfBRzbXzHjBSAwAAAFLdYNoOAAAA; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd' \
--data-urlencode 'client_id={clinetid}' \
--data-urlencode 'resource=https://management.core.windows.net' \
--data-urlencode 'client_secret={clientsecret}' \
--data-urlencode 'grant_type=client_credentials'
please let me know incase of further queries, I would be happy to assist you.
To benefit the community find the right answers, please do mark the post which was helpful by clicking on ‘Accept Answer’ & ‘Up-Vote’.