Skip to content

Commit

Permalink
fix(api): sso payload should not be a string
Browse files Browse the repository at this point in the history
  • Loading branch information
richardlt committed Jan 10, 2020
1 parent 56dc111 commit 3b7e55c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions engine/api/authentication/corpsso/jws.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
)

type ssoSigninToken struct {
IssuedAt int64 `json:"iat"`
RequireMFA bool `json:"requireMFA,omitempty"`
Data string `json:"data"`
IssuedAt int64 `json:"iat"`
RequireMFA bool `json:"requireMFA,omitempty"`
Data map[string]interface{} `json:"data"`
}

type nonceSource struct{}
Expand Down Expand Up @@ -45,9 +45,13 @@ func prepareRequest(requestSigningKey string, request sdk.AuthSigninConsumerToke
if err != nil {
return "", sdk.WithStack(err)
}
var requestData map[string]interface{}
if err := json.Unmarshal(requestJSON, &requestData); err != nil {
return "", sdk.WithStack(err)
}

data, err := json.Marshal(ssoSigninToken{
Data: string(requestJSON),
Data: requestData,
IssuedAt: request.IssuedAt,
RequireMFA: request.RequireMFA,
})
Expand Down

0 comments on commit 3b7e55c

Please sign in to comment.