BuildAuthResponseCodeResponsePayload generates the authorization code response payload for the authentication request
(ctx context.Context, authReq AuthRequest, authorizer Authorizer)
| 523 | |
| 524 | // BuildAuthResponseCodeResponsePayload generates the authorization code response payload for the authentication request |
| 525 | func BuildAuthResponseCodeResponsePayload(ctx context.Context, authReq AuthRequest, authorizer Authorizer) (*CodeResponseType, error) { |
| 526 | code, err := CreateAuthRequestCode(ctx, authReq, authorizer.Storage(), authorizer.Crypto()) |
| 527 | if err != nil { |
| 528 | return nil, err |
| 529 | } |
| 530 | |
| 531 | sessionState := "" |
| 532 | if authRequestSessionState, ok := authReq.(AuthRequestSessionState); ok { |
| 533 | sessionState = authRequestSessionState.GetSessionState() |
| 534 | } |
| 535 | |
| 536 | return &CodeResponseType{ |
| 537 | Code: code, |
| 538 | State: authReq.GetState(), |
| 539 | SessionState: sessionState, |
| 540 | }, nil |
| 541 | } |
| 542 | |
| 543 | // BuildAuthResponseCallbackURL generates the callback URL for a successful authorization code response |
| 544 | func BuildAuthResponseCallbackURL(ctx context.Context, authReq AuthRequest, authorizer Authorizer) (string, error) { |
searching dependent graphs…