Aspnetcore.docs: Postman "Get New Access Token" not working

Created on 16 Sep 2018  Â·  12Comments  Â·  Source: dotnet/AspNetCore.Docs

Looking at the section of requesting the access token using postman it seems following these steps leads to:
invalid_request
Error
in the postman console.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

P1 Source - Docs.ms

Most helpful comment

The issue is probably with your scope definition. Check that your scope url is set to the AppID URI on your API. In the instructions:

The newly registered web app needs permission to access the web API on the user's behalf.
Select Postman in the list of apps and then select API access from the menu on the left.
Select + Add.
---- > In the Select API dropdown, select the name of the web API.
In the Select Scopes dropdown, ensure all scopes are selected.
Select Ok.

The web api you select here should have an APP ID, make sure it is set and is reflected in the scope portion of your request.

All 12 comments

I have the same issue. Followed the tutorial from start to finish.

Adding to this, if you open up the dev tools View -> Developer -> Show Dev Tools (Current View) and then navigate to the console tab of the dev tools window and execute the request you should get an error as follows:

{
    error: "invalid_request", 
    error_description: "AADB2C90205:+This+application+does+not+have+sufficient+permissions+against+this+web+resource+to+perform+the+operation. Correlation+ID:+35604aa2-0aea-400e-b82b-153de948bdbb Timestamp:+2018-09-18+01:32:53Z"
}

The issue is probably with your scope definition. Check that your scope url is set to the AppID URI on your API. In the instructions:

The newly registered web app needs permission to access the web API on the user's behalf.
Select Postman in the list of apps and then select API access from the menu on the left.
Select + Add.
---- > In the Select API dropdown, select the name of the web API.
In the Select Scopes dropdown, ensure all scopes are selected.
Select Ok.

The web api you select here should have an APP ID, make sure it is set and is reflected in the scope portion of your request.

I'm the author. What @aerostudios said is, I think, the best suggestion. If that's the issue, @knoxv1lle @victormarante and @andredublin please let me know and I'll fix the doc to call it out better. If that's not the issue, guess I need to do some troubleshooting and try to repro. 🙂

Hi @CamSoper @aerostudios I tried it again with the suggestion and still get the same error.

Hi, I ran into this issue today too. It seems that you have to specify App ID URI and then add API Access for user_impersonation scope. Make sure to use App ID URI in scope name when specifying it in Postman.

I'll take a look at it tomorrow.

I just merged https://github.com/aspnet/Docs/pull/8661. This should fix it. Basically, take another look at the parameters in the token request. Things that weren't very strict before are apparently stricter now. Also, double check the "allowed scopes" settings in the doc.

Postman authentication keeps returning this : AADSTS50011: The reply url specified in the request does not match the reply urls configured for the application: '12812aaa-4d0e-4585-a38d-1f32450d7c5e'.There is no application with this id in my AzureB2C Tenant... where is it coming from? How can I find the app and correct the redirect?

Having the same issue, can we validate that this documenation is still functional? I was able to get this working a while ago but having all kinds of trouble all over again. An update with the new b2clogin.com endpoint would be nice.

@nezoic - Understood. I was purposefully avoiding the b2clogin.com endpoint because Visual Studio still uses the old endpoint in the boilerplate code. It was working end-to-end when I checked in #8661 but apparently there's something still not accounted for. I'll hit it again.

I think we've got this doc fixed. The fixes in #8688 should cover it. Closing for the moment, but if people are still having trouble, please let me know.

Was this page helpful?
0 / 5 - 0 ratings