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 Scope value predefined in the specification (profile, email, address, phone) #385

Open
arukiidou opened this issue Aug 14, 2023 · 2 comments · May be fixed by #387
Open

Add Scope value predefined in the specification (profile, email, address, phone) #385

arukiidou opened this issue Aug 14, 2023 · 2 comments · May be fixed by #387

Comments

@arukiidou
Copy link

arukiidou commented Aug 14, 2023

Summary

If I open this PR, is it acceptable?

Citation of specifications

https://openid.net/specs/openid-connect-core-1_0.html

5.4.  Requesting Claims using Scope Values
profile
OPTIONAL. This scope value requests access to the End-User's default profile Claims, which are: name, family_name, given_name, middle_name, nickname, preferred_username, profile, picture, website, gender, birthdate, zoneinfo, locale, and updated_at.
email
OPTIONAL. This scope value requests access to the email and email_verified Claims.
address
OPTIONAL. This scope value requests access to the address Claim.
phone
OPTIONAL. This scope value requests access to the phone_number and phone_number_verified Claims.

Key changes.

  • Omit examples and document updates yet - if you favor this proposal, I will start.
const (
	ScopeProfile = "profile"
	ScopeEmail = "email"
	ScopeAddress = "address"
	ScopePhone = "phone"
)

Anticipated Questions

        // before
	config := oauth2.Config{
		Scopes:       []string{oidc.ScopeOpenID, "profile", "email"},
	}
        // after
	config := oauth2.Config{
		Scopes:       []string{oidc.ScopeOpenID, oidc.ScopeProfile, oidc.ScopeEmail},
	}
@arukiidou arukiidou changed the title Add acope value constants: (profile, email, address, phone) Add predefined scope values as constants: (profile, email, address, phone) Aug 14, 2023
@arukiidou arukiidou changed the title Add predefined scope values as constants: (profile, email, address, phone) Add Scope value predefined in the specification (profile, email, address, phone) Aug 15, 2023
@ericchiang
Copy link
Collaborator

Yeah this sounds reasonable, feel free to send a PR!

arukiidou added a commit to arukiidou/go-oidc that referenced this issue Aug 15, 2023
Signed-off-by: junya koyama <arukiidou@yahoo.co.jp>
arukiidou added a commit to arukiidou/go-oidc that referenced this issue Aug 15, 2023
Signed-off-by: junya koyama <arukiidou@yahoo.co.jp>
@arukiidou
Copy link
Author

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 a pull request may close this issue.

2 participants