Skip to content
This repository has been archived by the owner on Mar 3, 2022. It is now read-only.

Add UserInfo JWT response support #636

Merged
merged 2 commits into from
Feb 10, 2019
Merged

Conversation

asleire
Copy link
Contributor

@asleire asleire commented Aug 7, 2018

Fixes #635

  • JsonService now has an optional jwtHandler parameter.
    • If this parameter is set, application/jwt is added to valid content types. When receiving a valid response with content type application/jwt, the jwtHandler will be invoked rather than simply parsing the response body as JSON.
    • The handler is responsible for validating the JWT and extracting its payload
  • UserInfoService now creates a JsonService using a custom jwtHandler. The handler code is copied from ResponseValidator with minor adaptions.
  • JoseUtil.validateJwt now has an optional timeInsentive parameter which defaults to false. If this value is true, the claims iat, nbf and exp will not be validated.
    • These claims are not mentioned in the OpenId 1.0 Spec (5.3.2/5.3.4)
  • A new setting has been added: userInfoJwtIssuer?: 'ANY' | 'OP' | string;
    • Determines how the UserInfo JWT's issuer claim is validated
      • ANY means the issuer claim is ignored
      • OP means the issues claim must match the OP's issuer identifier URL
      • string allows for a custom specified issuer
    • The OpenID 1.0 spec (5.3.2) recommends that an issuer claim is included and that it equals the OP's issuer identifier URL, but this is not required

@brockallen
Copy link
Member

Hi -- I finally had time for this and it looks great. What OP are you using that returns JWTs from user info?

@asleire
Copy link
Contributor Author

asleire commented Jan 6, 2019

Hi -- I finally had time for this and it looks great. What OP are you using that returns JWTs from user info?

It's a Norwegian identity provider called BankID

@brockallen
Copy link
Member

There are some conflicts -- do you mind having a look?

@asleire
Copy link
Contributor Author

asleire commented Jan 13, 2019

Conflict has been resolved

@brockallen brockallen added this to the 1.7.0 milestone Feb 3, 2019
@brockallen brockallen merged commit 5bbc961 into IdentityModel:dev Feb 10, 2019
@brockallen
Copy link
Member

Merged, thanks

@brockallen
Copy link
Member

1.7.0-beta.1 has been published to npm, please test and see if it's working for you.

@asleire
Copy link
Contributor Author

asleire commented Feb 11, 2019

Tested, it works :-)

By the way there's a duplicate property "expires_in" in https://github.com/IdentityModel/oidc-client-js/blob/dev/index.d.ts causing a compliation error

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging this pull request may close these issues.

2 participants