nuxt-community / auth-module

Zero-boilerplate authentication support for Nuxt 2
https://auth.nuxtjs.org
MIT License
1.93k stars 925 forks source link

oidc scheme not using userinfo endpoint #1724

Open KoenTech opened 2 years ago

KoenTech commented 2 years ago

When signing in with openIDConnect, there should be an option to get the user information from the userinfo endpoint instead of the idToken because some oidc servers only send basic userinfo in the idToken, but claims like the username or email address can be fetched from the userinfo endpoint. This issue could be resolved by configuring the oidc server to include all claims in the idToken, but that would make the token really long when a user has a lot of claims.

Is it possible to make the userinfo source (endpoint or idToken) configurable through the configuration?

jle-novicell commented 2 years ago

I've found that the OIDC strategy doesn't make a request to userInfo, too (in the browser, anyway). $auth.user never includes the claims I need.

My workaround is to decode the JWT and use the data from that instead.