Get an API Access Token through REST Calls

%3CLINGO-SUB%20id%3D%22lingo-sub-207501%22%20slang%3D%22en-US%22%3EGet%20an%20API%20Access%20Token%20through%20REST%20Calls%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-207501%22%20slang%3D%22en-US%22%3E%3CP%3EFor%20a%20week%20now%20I%20have%20not%20been%20able%20to%20figure%20out%20how%20to%20grab%20a%20bearer%20access%20token%20through%20REST%20API%20calls.%20I%20found%20the%20following%20guide%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3E%3CA%20href%3D%22http%3A%2F%2Fwww.vibhutisinha.com%2F2014%2F09%2Fstep-by-step-to-create-authorization.html%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fwww.vibhutisinha.com%2F2014%2F09%2Fstep-by-step-to-create-authorization.html%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EUnfortunately%2C%20after%20following%20the%20steps%2C%20I%20was%20receiving%20an%20authorization%20error%20from%20the%20API%20call%20to%20get%20the%20access%20token.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDoes%20anybody%20know%20of%20a%20way%20for%20me%20to%20gain%20access%20to%20a%20bearer%20access%20token%20via%20REST%20API%20calls%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-207667%22%20slang%3D%22en-US%22%3ERe%3A%20Get%20an%20API%20Access%20Token%20through%20REST%20Calls%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-207667%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EThey%20should%20not%20require%20Tenant%20Admin%20Approval.%20I%20am%20simply%20trying%20to%20send%20a%20request%20to%20the%20following%20URL%3A%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Faccounts.accesscontrol.windows.net%2Ftokens%2FOAuth%2F2%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Faccounts.accesscontrol.windows.net%2Ftokens%2FOAuth%2F2%3C%2FA%3E%3CSPAN%3E%26nbsp%3Band%20receive%20the%20bearer%20access%20token.%20According%20to%20the%20guide%20that%20I%20mentioned%20above%2C%20I%20should%20be%20good%20to%20get%20the%20token%20after%20I%20hit%20the%20%22Trust%20It%22%20button%20for%20the%20app.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-207664%22%20slang%3D%22en-US%22%3ERe%3A%20Get%20an%20API%20Access%20Token%20through%20REST%20Calls%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-207664%22%20slang%3D%22en-US%22%3E%3CP%3EDo%20your%20permissions%20require%20Tenant%20Admin%20Approval%3F%20(What%20permissions%20are%20you%20trying%20to%20grant)%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

For a week now I have not been able to figure out how to grab a bearer access token through REST API calls. I found the following guide:

http://www.vibhutisinha.com/2014/09/step-by-step-to-create-authorization.html

 

Unfortunately, after following the steps, I was receiving an authorization error from the API call to get the access token. 

 

Does anybody know of a way for me to gain access to a bearer access token via REST API calls?

2 Replies
Highlighted

Do your permissions require Tenant Admin Approval? (What permissions are you trying to grant)

Highlighted

They should not require Tenant Admin Approval. I am simply trying to send a request to the following URL: https://accounts.accesscontrol.windows.net/tokens/OAuth/2 and receive the bearer access token. According to the guide that I mentioned above, I should be good to get the token after I hit the "Trust It" button for the app.