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

Add claims parameter to authorize #1045

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

frereit
Copy link

@frereit frereit commented Dec 13, 2024

Description

Currently, the setClaims method of App Auth is not exposed. By adding a new key claims to AuthConfig, similar to scopes, when it is set, we can call setClaims on the AuthorizationRequest.Builder to add the requested claims to the authorization request.

Steps to verify

Create a AuthConfiguration that requests some claims about the user:

const config: AuthConfiguration = {
  issuer: 'http://example',
  clientId: '....',
  redirectUrl: 'localhost:8080',
  scopes: ['openid', 'offline_access'],
  claims: { "id_token": { "email": null } }
}

Then, use authorize to obtain an idToken, and verify that the requested claims are included in the token.

Draft

This PR implements the claims key in the AuthConfiguration on the Android side. However, I do not own iOS devices and can therefore not implement this for iOS. I am opening this PR in the hopes that someone else completes it for the iOS side.

Copy link

changeset-bot bot commented Dec 13, 2024

⚠️ No Changeset found

Latest commit: 7002ea6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Dec 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-native-app-auth ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 15, 2024 8:16pm

Copy link
Contributor

@carbonrobot carbonrobot left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Although we don't technically support Open ID Connect (OIDC), I can't see any reason not support this.

  • Add support in AppAuth-iOS
  • Documentation updates

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

Successfully merging this pull request may close these issues.

2 participants