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

Access OIDC token information from Angular SPA #10

Closed
godfriedmeesters opened this issue Sep 23, 2022 · 1 comment
Closed

Access OIDC token information from Angular SPA #10

godfriedmeesters opened this issue Sep 23, 2022 · 1 comment

Comments

@godfriedmeesters
Copy link

What would be the best way to access the information encoded in the OpenID token from the Angular SPA side? For example, I want to display the user's name in the SPA after login.

As far as I understand no tokens at all are available directly to the SPA.

@marcusdacoregio
Copy link
Collaborator

You can have an endpoint in your BFF that just returns whatever is in the currently Authentication object, something like this:

@GetMapping("/user/me")
public Authentication getCurrentAuthentication(Authentication authentication) {
    return authentication;
}

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

2 participants