Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions internal/models/oauth_scope.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import "strings"

// OAuth/OIDC scope constants
const (
ScopeOpenID = "openid"
ScopeEmail = "email"
ScopeProfile = "profile"
ScopePhone = "phone"
ScopeOpenID = "openid"
ScopeEmail = "email"
ScopeProfile = "profile"
ScopePhone = "phone"
ScopeOfflineAccess = "offline_access"
)

// SupportedOAuthScopes defines all OAuth/OIDC scopes supported by the server
Expand All @@ -16,6 +17,7 @@ var SupportedOAuthScopes = []string{
ScopeProfile,
ScopeEmail,
ScopePhone,
ScopeOfflineAccess,
}

// IsSupportedScope checks if a scope is in the supported scopes list
Expand Down
5 changes: 5 additions & 0 deletions internal/models/oauth_scope_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,11 @@ func TestIsSupportedScope(t *testing.T) {
scope: ScopePhone,
expected: true,
},
{
name: "offline_access scope is supported",
scope: ScopeOfflineAccess,
expected: true,
},
{
name: "unsupported scope address",
scope: "address",
Expand Down