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

Improve OIDC compliance: integrate IDTV #344

Merged
merged 7 commits into from
Jan 28, 2020

Conversation

Widcket
Copy link
Contributor

@Widcket Widcket commented Jan 27, 2020

Changes

This update improves the SDK support for OpenID Connect (OIDC). In particular, it hooks the ID Token validation logic in the authentication flows.

What’s being added in this PR

  • Tests for the jwks endpoint.

What’s being changed in this PR

  • Removed the decodeJwt(_:) method from CredentialsManager.swift and replaced it with calls to JWTDecode logic.
  • Changed the signature of the (internal) method validate(idToken:context:signatureValidator:claimsValidator:callback:) to use for as the external name for the parameter context, for the sake of API expressiveness.
  • Changed the signature of the initialisers of the (internal) structs ImplicitGrant and PKCE in order to pass the parameters needed to perform ID Token validation.
  • Updated existing tests to account for ID Token validation.

Public surface area

  • Additions: the methods leeway(_:) and maxAge(_:) in the WebAuth builder.
  • Changes: none.

Testing

Please describe how this can be tested by reviewers. Be specific about anything not tested and reasons why. If this library has unit and/or integration testing, tests should be added for new functionality and existing tests should complete without errors.

  • This change adds unit test coverage
  • This change has been tested on the latest version of the platform/language or why not

Checklist

@Widcket Widcket added the bug This points to a verified bug in the code label Jan 27, 2020
@Widcket Widcket added this to the vNext milestone Jan 27, 2020
@Widcket Widcket requested a review from a team January 27, 2020 15:41
@Widcket Widcket added CH: Changed large and removed bug This points to a verified bug in the code labels Jan 27, 2020
Copy link
Contributor

@joshcanhelp joshcanhelp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly questions but some might lead to changes.

Nice work on this! Hopefully this was helpful, Swift is difficult for me to read, lots of unfamiliar syntax!

Auth0/IDTokenValidatorContext.swift Show resolved Hide resolved
Auth0/OAuth2Grant.swift Show resolved Hide resolved
Auth0/OAuth2Grant.swift Show resolved Hide resolved
Auth0/OAuth2Grant.swift Show resolved Hide resolved
Auth0/OAuth2Grant.swift Show resolved Hide resolved
Auth0/OAuth2Grant.swift Outdated Show resolved Hide resolved
Auth0/OAuth2Grant.swift Outdated Show resolved Hide resolved
Auth0/SafariWebAuth.swift Outdated Show resolved Hide resolved
Auth0/SafariWebAuth.swift Outdated Show resolved Hide resolved
Auth0Tests/OAuth2GrantSpec.swift Outdated Show resolved Hide resolved
Auth0/OAuth2Grant.swift Show resolved Hide resolved
Auth0/OAuth2Grant.swift Outdated Show resolved Hide resolved
Auth0/OAuth2Grant.swift Show resolved Hide resolved
Auth0/OAuth2Grant.swift Outdated Show resolved Hide resolved
Auth0/OAuth2Grant.swift Outdated Show resolved Hide resolved
Auth0/SafariWebAuth.swift Outdated Show resolved Hide resolved
Auth0/WebAuth.swift Outdated Show resolved Hide resolved
Auth0/WebAuth.swift Outdated Show resolved Hide resolved
Auth0Tests/OAuth2GrantSpec.swift Outdated Show resolved Hide resolved
Auth0Tests/OAuth2GrantSpec.swift Outdated Show resolved Hide resolved
Widcket and others added 2 commits January 27, 2020 19:58
Co-Authored-By: Luciano Balmaceda <balmacedaluciano@gmail.com>
@Widcket
Copy link
Contributor Author

Widcket commented Jan 28, 2020

@joshcanhelp can you please also check the domain logic in this entire file?
It contains the implementations of OAuth2 grants (implicit and code flow).
https://github.com/auth0/Auth0.swift/blob/ca28451be12118c8928745aead45feaa63e669e1/Auth0/OAuth2Grant.swift

Auth0/SafariWebAuth.swift Outdated Show resolved Hide resolved
@Widcket Widcket merged commit fadbe63 into feature/oidc-compliance Jan 28, 2020
@Widcket Widcket deleted the oidc-compliance/integration branch January 28, 2020 19:36
@Widcket Widcket removed this from the 1.21.0 milestone Jul 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants