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

isAuthenticated stays false - despite successful login #260

Closed
MarcinSzalomski opened this issue Oct 24, 2024 · 1 comment
Closed

isAuthenticated stays false - despite successful login #260

MarcinSzalomski opened this issue Oct 24, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@MarcinSzalomski
Copy link

MarcinSzalomski commented Oct 24, 2024

Describe the issue:

Hello together, i've tried to integrate @asgardeo/auth-react into my React project to handle the login functionality via WSO2. After calling the signIn function from the useAuthContext-Hook, i get correctly redirected to the login page where i can input the data. After successful login, i get redirected back to my application, where a token-Request is being sent out automatically - that works also. However the state.isAuthenticated variable always stays false - despite the sucessful login.

State during login:
image

State after login:
image

Sucessful token fetch:
image

How to reproduce:

const config = {
  signInRedirectURL: loginUrl,
  signOutRedirectURL: logoutUrl,
  clientID: process.env.WSO2_CLIENT_ID,
  baseUrl: process.env.WSO2_BASE_URL,
  scope: ['openid'],
}

Expected behavior:

Environment information (Please complete the following information; remove any unnecessary fields) :

  • Product Version: 5.2.1
  • OS: MacOS
  • React: 18.3.1
  • Webpack: 5.93.0
  • Node: 20.12.2

Optional Fields

Related issues:
#143

@MarcinSzalomski MarcinSzalomski added the bug Something isn't working label Oct 24, 2024
@MarcinSzalomski
Copy link
Author

MarcinSzalomski commented Oct 24, 2024

Found the solution - it turns out, the well-known endpoint of my instance was different that the default one.
All i had to do is to mention the URL of my endpoint as wellKnownEndpoint attribute inside the config object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant