Debian Codegraph @

pkg/oidc/jwt_profile.go

raw
1 package oidc
2
3 type JWTProfileGrantRequest struct {
4 Assertion string `schema:"assertion"`
5 Scope SpaceDelimitedArray `schema:"scope"`
6 GrantType GrantType `schema:"grant_type"`
7 }
8
9 // NewJWTProfileGrantRequest creates an oauth2 `JSON Web Token (JWT) Profile` Grant
10 //`urn:ietf:params:oauth:grant-type:jwt-bearer`
11 // sending a self-signed jwt as assertion
12 func NewJWTProfileGrantRequest(assertion string, scopes ...string) *JWTProfileGrantRequest {
13 return &JWTProfileGrantRequest{
14 GrantType: GrantTypeBearer,
15 Assertion: assertion,
16 Scope: scopes,
17 }
18 }