mirror of
https://github.com/andwati/zitadel.git
synced 2026-12-03 09:28:55 +00:00
feat: device authorization RFC 8628 (#5646)
* device auth: implement the write events * add grant type device code * fix(init): check if default value implements stringer --------- Co-authored-by: adlerhurst <[email protected]>
This commit is contained in:
co-authored by
adlerhurst
parent
3cd2cecfdf
commit
5819924275
@@ -22,6 +22,7 @@ type AuthRequestType int32
|
||||
const (
|
||||
AuthRequestTypeOIDC AuthRequestType = iota
|
||||
AuthRequestTypeSAML
|
||||
AuthRequestTypeDevice
|
||||
)
|
||||
|
||||
type AuthRequestOIDC struct {
|
||||
@@ -56,3 +57,18 @@ func (a *AuthRequestSAML) Type() AuthRequestType {
|
||||
func (a *AuthRequestSAML) IsValid() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
type AuthRequestDevice struct {
|
||||
ID string
|
||||
DeviceCode string
|
||||
UserCode string
|
||||
Scopes []string
|
||||
}
|
||||
|
||||
func (*AuthRequestDevice) Type() AuthRequestType {
|
||||
return AuthRequestTypeDevice
|
||||
}
|
||||
|
||||
func (a *AuthRequestDevice) IsValid() bool {
|
||||
return a.DeviceCode != "" && a.UserCode != "" && len(a.Scopes) > 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user