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

NbOAuth2AuthStrategy show errors from login response #6010

Open
1 of 3 tasks
GiamBoscaro opened this issue Nov 27, 2023 · 0 comments
Open
1 of 3 tasks

NbOAuth2AuthStrategy show errors from login response #6010

GiamBoscaro opened this issue Nov 27, 2023 · 0 comments

Comments

@GiamBoscaro
Copy link

Issue type

  • bug report
  • feature request
  • question about the decisions made in the repository

Issue description

I have setup a login through Keycloak. When I login with wrong credentials, I do see Keycloak responding with "Invalid credentials". I would like to display this error, but "Something went wrong" is always shown. How can I show the error coming from Keycloak? I have already checked similar issues like #442 and #1835 but there is no "errors" property in the NbOAuth2AuthStrategy setup.

Current behavior:
When I login with invalid credentials, the error "Something went wrong" is shown.

Expected behavior:
The error in the login response should be shown

Steps to reproduce:
Login with invalid credentials using the NbOAuth2AuthStrategy

Related code:

NbOAuth2AuthStrategy.setup({
        name: 'keycloak',
        baseEndpoint: environment.keycloak.uri,
        clientId: environment.keycloak.client_id,
        clientSecret: environment.keycloak.client_secret,
        clientAuthMethod: NbOAuth2ClientAuthMethod.BASIC,
        authorize: {
          endpoint: '/auth',
          responseType: NbOAuth2ResponseType.TOKEN,
        },
        token: {
          endpoint: '/token',
          grantType: NbOAuth2GrantType.PASSWORD,
          class: NbAuthOAuth2JWTToken,
        },
        refresh: {
          endpoint: '/token',
          grantType: NbOAuth2GrantType.REFRESH_TOKEN,
        },
      })

Other information:

node v14.21.3

Angular, Nebular

Angular 13.3.12
Nebular 9.1.0-rc.8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant