mirror of
https://github.com/zitadel/zitadel.git
synced 2025-01-10 20:03:40 +00:00
42 lines
1.2 KiB
Go
42 lines
1.2 KiB
Go
|
package domain
|
||
|
|
||
|
import (
|
||
|
"github.com/zitadel/saml/pkg/provider"
|
||
|
)
|
||
|
|
||
|
type SAMLErrorReason int32
|
||
|
|
||
|
const (
|
||
|
SAMLErrorReasonUnspecified SAMLErrorReason = iota
|
||
|
SAMLErrorReasonVersionMissmatch
|
||
|
SAMLErrorReasonAuthNFailed
|
||
|
SAMLErrorReasonInvalidAttrNameOrValue
|
||
|
SAMLErrorReasonInvalidNameIDPolicy
|
||
|
SAMLErrorReasonRequestDenied
|
||
|
SAMLErrorReasonRequestUnsupported
|
||
|
SAMLErrorReasonUnsupportedBinding
|
||
|
)
|
||
|
|
||
|
func SAMLErrorReasonToString(reason SAMLErrorReason) string {
|
||
|
switch reason {
|
||
|
case SAMLErrorReasonUnspecified:
|
||
|
return "unspecified error"
|
||
|
case SAMLErrorReasonVersionMissmatch:
|
||
|
return provider.StatusCodeVersionMissmatch
|
||
|
case SAMLErrorReasonAuthNFailed:
|
||
|
return provider.StatusCodeAuthNFailed
|
||
|
case SAMLErrorReasonInvalidAttrNameOrValue:
|
||
|
return provider.StatusCodeInvalidAttrNameOrValue
|
||
|
case SAMLErrorReasonInvalidNameIDPolicy:
|
||
|
return provider.StatusCodeInvalidNameIDPolicy
|
||
|
case SAMLErrorReasonRequestDenied:
|
||
|
return provider.StatusCodeRequestDenied
|
||
|
case SAMLErrorReasonRequestUnsupported:
|
||
|
return provider.StatusCodeRequestUnsupported
|
||
|
case SAMLErrorReasonUnsupportedBinding:
|
||
|
return provider.StatusCodeUnsupportedBinding
|
||
|
default:
|
||
|
return "unspecified error"
|
||
|
}
|
||
|
}
|