Skip to content

Not getting access token #69

@timduncan-innowell

Description

@timduncan-innowell

Hi,

After downloading the b2c-sample application and making config changes for my B2C tenant, I cannot get an access token back from getTokensAsync().

Here is my config:

<AuthProvider
         tenant="myapp"
         appId="<appId>"
         loginPolicy="B2C_1A_signin"
         passwordResetPolicy="B2C_1A_PASSWORD_RESET"
         profileEditPolicy="B2C_1_ProfleEdit"
         redirectURI="msauth://com.myapp/<signature_hash>"
>

I correctly get the B2C hosted signin page after clicking the LOGIN button. After entering a correct user name and password the Protected page displays "Could not authenticate".

What I do get from getTokensAsync() is:

{
  "access": "", 
  "error": null, 
  "expiresOn": 0, 
  "id": "", 
  "isAuthentic": false, 
  "url": "msauth://com.myapp/<signature_hash>?code=eyJraWQiOiIxVG9LRlVnM1lVNE9ET1lJbz..." 
}

The url seems to be the first part of the authorization code flow and afaik the package should be exchanging the authorization code for access & id tokens. The exchange does not seem to take place.

Have I done something wrong to stop the authorization code from being processed by the package and used in a token exchange?

Any help appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions