in pkg/internal/pop/authnscheme.go [55:74]
func (as *PoPAuthenticationScheme) FormatAccessTokenWithOptions(accessToken, nonce string, timestamp int64) (string, error) {
header := header{
typ: popTokenType,
alg: as.PoPKey.Alg(),
kid: as.PoPKey.KeyID(),
}
payload := payload{
at: accessToken,
ts: timestamp,
host: as.Host,
jwk: as.PoPKey.JWK(),
nonce: nonce,
}
popAccessToken, err := createPoPAccessToken(header, payload, as.PoPKey)
if err != nil {
return "", fmt.Errorf("error formatting PoP token: %w", err)
}
return popAccessToken.ToBase64(), nil
}