pow-auth / assent

Multi-provider framework in Elixir
https://powauth.com
MIT License
406 stars 47 forks source link

Refactor OIDC get_user handling #48

Closed danschultzer closed 4 years ago

danschultzer commented 4 years ago

The OIDC strategy now calls the strategy get_user/2 directly rather than the previous nested call. This means that any custom implementation of get_user/2 for a OIDC strategy must use the validate_id_token/2 method to conform to OIDC specs.

The default get_user/2 behavior is to use the claims in the ID token rather than, as previously, fetching from the userinfo endpoint. The two strategies using OIDC uses the claims already so this simplifies things. If a strategy needs to call the userinfo endpoint, fetch_userinfo/2 has been added that conforms with validation requirements from the OIDC specs.