Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where to check and create user on resource server with AXA OIDC React library? #1383

Open
uhexos opened this issue Jun 8, 2024 · 0 comments

Comments

@uhexos
Copy link

uhexos commented Jun 8, 2024

Issue and Steps to Reproduce

Description:
I'm using the AXA OIDC React library for authentication in my application, and I need to implement functionality to check if the authenticated user exists on my resource server (API). If the user does not exist, I need to create a new user record on the resource server.

I'm not sure at which point in the authentication flow or which part of the library I should be implementing this functionality. Can someone point me in the right direction or provide guidance on where in the library's lifecycle I should be checking and creating the user on the resource server? I tried implementing this in the callbackSuccessComponent but the /api/me endpoint keeps getting a 401 because the bearer token is not set yet with useOidcFetch();

Additional Information:

  • I'm using the latest version of the AXA OIDC React library
  • My resource server is a springboot application.
  • I'm planning to use the access token obtained from the library to make requests to the resource server.
  • Also using react query

Any advice or documentation references would be greatly appreciated.

Versions

Screenshots

Expected

Actual

Additional Details

  • Installed packages:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant