fix: add state in access token response (implicit flow)
This commit is contained in:
parent
bb4d854efe
commit
f345ddd0c5
2 changed files with 4 additions and 0 deletions
|
@ -396,6 +396,7 @@ type AccessTokenResponse struct {
|
||||||
RefreshToken string `json:"refresh_token,omitempty" schema:"refresh_token,omitempty"`
|
RefreshToken string `json:"refresh_token,omitempty" schema:"refresh_token,omitempty"`
|
||||||
ExpiresIn uint64 `json:"expires_in,omitempty" schema:"expires_in,omitempty"`
|
ExpiresIn uint64 `json:"expires_in,omitempty" schema:"expires_in,omitempty"`
|
||||||
IDToken string `json:"id_token,omitempty" schema:"id_token,omitempty"`
|
IDToken string `json:"id_token,omitempty" schema:"id_token,omitempty"`
|
||||||
|
State string `json:"state,omitempty" schema:"state,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type JWTProfileAssertionClaims interface {
|
type JWTProfileAssertionClaims interface {
|
||||||
|
|
|
@ -35,11 +35,13 @@ func CreateTokenResponse(ctx context.Context, request IDTokenRequest, client Cli
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var state string
|
||||||
if authRequest, ok := request.(AuthRequest); ok {
|
if authRequest, ok := request.(AuthRequest); ok {
|
||||||
err = creator.Storage().DeleteAuthRequest(ctx, authRequest.GetID())
|
err = creator.Storage().DeleteAuthRequest(ctx, authRequest.GetID())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
state = authRequest.GetState()
|
||||||
}
|
}
|
||||||
|
|
||||||
exp := uint64(validity.Seconds())
|
exp := uint64(validity.Seconds())
|
||||||
|
@ -49,6 +51,7 @@ func CreateTokenResponse(ctx context.Context, request IDTokenRequest, client Cli
|
||||||
RefreshToken: newRefreshToken,
|
RefreshToken: newRefreshToken,
|
||||||
TokenType: oidc.BearerToken,
|
TokenType: oidc.BearerToken,
|
||||||
ExpiresIn: exp,
|
ExpiresIn: exp,
|
||||||
|
State: state,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue