khurlburt
10 years agoOccasional Contributor
OAuth 2 Flow - Error getting token due to bad request
I have SoapUI Pro 5.1.2. I am attempting to get a token using OAuth2 Flow = "Authorization Code Grant".
In the SoapUI popup (titled "Get Access Token from the authorization server") I provide all of the following:
Client Identification
Client Secret
Authorization URI
Access Token URI
Redirect URI
I then click the "Get Access Token" button and I'm prompted to sign into Microsoft Azure (where my service resides). Next, I enter my credentials (which are accepted), and see the "Received authorization code" message (within the SoapUI popup (titled "Get Access Token from the authorization server")). Next, A window with the message "The page could not be loaded" pops up. When I close that window - the "Received authorization code" message (on SoapUI popup (titled "Get Access Token from the authorization server")) is replaced with "Retrieval canceled".
So I never get the token. However - Looking at the HTTP log: I DO get the Authorization Code.
Here is the error I see in the HTTP log:
Thu Dec 04 18:23:48 EST 2014:DEBUG:<< "HTTP/1.1 400 Bad Request[\r][\n]"
Thu Dec 04 18:24:44 EST 2014:DEBUG:<< "{"error":"invalid_request","error_description":"ACS50001: The required field \u0027resource\u0027 is missing.\r\nTrace ID: 79c923cb-4cc6-4a4d-9dcf-fb578f3a8c01\r\nCorrelation ID: 11a3007a-4387-436f-9669-b52fcf222a49\r\nTimestamp: 2014-12-04 23:24:45Z","error_codes":[50001],"timestamp":"2014-12-04 23:24:45Z","trace_id":"79c923cb-4cc6-4a4d-9dcf-fb578f3a8c01","correlation_id":"11a3007a-4387-436f-9669-b52fcf222a49"}"
The problem is that I don't see where I can supply the resource in the SoapUI popup (titled "Get Access Token from the authorization server"). And if the solution is that I need to add it to the input string for the "Access Token URI" textbox, what is the proper syntax? I am currently using "https://login.windows.net/mckdev.onmicrosoft.com/oauth2/token?api-version=1.0" as input for the "Access Token URI" textbox.
Any help with getting past this error would be greatly appreciated.
Thank you,
Kelli
In the SoapUI popup (titled "Get Access Token from the authorization server") I provide all of the following:
Client Identification
Client Secret
Authorization URI
Access Token URI
Redirect URI
I then click the "Get Access Token" button and I'm prompted to sign into Microsoft Azure (where my service resides). Next, I enter my credentials (which are accepted), and see the "Received authorization code" message (within the SoapUI popup (titled "Get Access Token from the authorization server")). Next, A window with the message "The page could not be loaded" pops up. When I close that window - the "Received authorization code" message (on SoapUI popup (titled "Get Access Token from the authorization server")) is replaced with "Retrieval canceled".
So I never get the token. However - Looking at the HTTP log: I DO get the Authorization Code.
Here is the error I see in the HTTP log:
Thu Dec 04 18:23:48 EST 2014:DEBUG:<< "HTTP/1.1 400 Bad Request[\r][\n]"
Thu Dec 04 18:24:44 EST 2014:DEBUG:<< "{"error":"invalid_request","error_description":"ACS50001: The required field \u0027resource\u0027 is missing.\r\nTrace ID: 79c923cb-4cc6-4a4d-9dcf-fb578f3a8c01\r\nCorrelation ID: 11a3007a-4387-436f-9669-b52fcf222a49\r\nTimestamp: 2014-12-04 23:24:45Z","error_codes":[50001],"timestamp":"2014-12-04 23:24:45Z","trace_id":"79c923cb-4cc6-4a4d-9dcf-fb578f3a8c01","correlation_id":"11a3007a-4387-436f-9669-b52fcf222a49"}"
The problem is that I don't see where I can supply the resource in the SoapUI popup (titled "Get Access Token from the authorization server"). And if the solution is that I need to add it to the input string for the "Access Token URI" textbox, what is the proper syntax? I am currently using "https://login.windows.net/mckdev.onmicrosoft.com/oauth2/token?api-version=1.0" as input for the "Access Token URI" textbox.
Any help with getting past this error would be greatly appreciated.
Thank you,
Kelli