Skip to content

Commit

Permalink
chore: check whether access token length is greater than 256 characters
Browse files Browse the repository at this point in the history
  • Loading branch information
Salaton committed Jan 17, 2023
1 parent 711a1bd commit cc8e1b1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ func (c *Client) verifyAccessToken(ctx context.Context, accessToken string) (*To
return nil, fmt.Errorf("unable to get access token from the input")
}

if len(accessToken) > 256 {
return nil, fmt.Errorf("ensure the token has no more than 255 characters")
}

introspectionURL := fmt.Sprintf("%s/v1/app/introspect/", c.configurations.AuthServerEndpoint)
payload := TokenIntrospectionPayload{
TokenType: "access_token",
Expand Down

0 comments on commit cc8e1b1

Please sign in to comment.