Skip to content

OAuthService(accessToken, idToken, claims) returns null after Google OAUTH2 Authentication is Success. #1462

Open
@anand-sakthivel

Description

@anand-sakthivel

Describe the bug.
OAuthService(accessToken, idToken, claims) returns null after Google OAUTH2 Authentication is successful. After manual refresh above values are populated.

Stackblitz example
N/A
Followed I Video in YouTube: https://www.youtube.com/watch?v=r4USQN5VnmY
Duration: 31:39

To Reproduce
Steps to reproduce the behavior:

  1. Using Google Identity Provider for authentication.(Created ClientId & redirect uri is HTTP://localhost:4200/fallback)
  2. Following initLoginFlow() & loadDiscoveryDocumentAndTryLogin() login page flow.
  3. I access localhost:4200 to get to the login page. When I click the login button, I can see the Google login page.
  4. After successful login google redirects to HTTP://localhost:4200/fallback
  5. Inside FallbackComponent(mapped /fallback path to FallbackComponent), I'm getting some log details like (OAuthService(accessToken, idToken, claims)), and it's null, But when I log sessionStorage the above value is not null(Proper login values like access token, id token claims, etc..).
  6. After manually refreshing the page HTTP://localhost:4200/fallback , I can see the log details with value OAuthService(accessToken, idToken, claims).

Expected behavior
What I expect is, After successful login in the redirect page without refreshing the page I should see the OAuthService values.

Desktop (please complete the following information):

  • OS: [Windows ]
  • Browser [chrome]
  • Version [Version 131.0.6778.266 (Official Build) (64-bit)]

Additional context
Add any other context about the problem here.

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