add invalid target error

This commit is contained in:
Tim Möhlmann 2024-03-13 13:55:56 +02:00
parent 6ac0bd329a
commit d83c9e12a5

View file

@ -27,6 +27,11 @@ const (
SlowDown errorType = "slow_down" SlowDown errorType = "slow_down"
AccessDenied errorType = "access_denied" AccessDenied errorType = "access_denied"
ExpiredToken errorType = "expired_token" ExpiredToken errorType = "expired_token"
// InvalidTarget error is returned by Token Exchange if
// the requested target or audience is invalid.
// [RFC 8693, Section 2.2.2: Error Response](https://www.rfc-editor.org/rfc/rfc8693#section-2.2.2)
InvalidTarget errorType = "invalid_target"
) )
var ( var (
@ -112,6 +117,14 @@ var (
Description: "The \"device_code\" has expired.", Description: "The \"device_code\" has expired.",
} }
} }
// Token exchange error
ErrInvalidTarget = func() *Error {
return &Error{
ErrorType: InvalidTarget,
Description: "The requested audience or target is invalid.",
}
}
) )
type Error struct { type Error struct {