Open
Description
Summary
- Add predefined scope values as const - included in the OpenID Connect Core 1.0 specs
- Add a description docs to each const
- Update example
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
- Should this be in golang.org/x/oauth2?
- What are the benefits? Why do it?
- Help users understand OIDC and go-oidc faster.
- "openid profile email" is a frequently used pattern in OIDC authentication
// before
config := oauth2.Config{
Scopes: []string{oidc.ScopeOpenID, "profile", "email"},
}
// after
config := oauth2.Config{
Scopes: []string{oidc.ScopeOpenID, oidc.ScopeProfile, oidc.ScopeEmail},
}
Metadata
Metadata
Assignees
Labels
No labels