mirror of https://github.com/jumpserver/jumpserver
[Update] 添加 authentication backend header
parent
0d2b4d7ca3
commit
5f2c9c3801
|
@ -106,6 +106,9 @@ class AccessKeyAuthentication(authentication.BaseAuthentication):
|
|||
raise exceptions.AuthenticationFailed(_('User disabled.'))
|
||||
return access_key.user, None
|
||||
|
||||
def authenticate_header(self, request):
|
||||
return 'Sign access_key_id:Signature'
|
||||
|
||||
|
||||
class AccessTokenAuthentication(authentication.BaseAuthentication):
|
||||
keyword = 'Bearer'
|
||||
|
@ -143,6 +146,9 @@ class AccessTokenAuthentication(authentication.BaseAuthentication):
|
|||
raise exceptions.AuthenticationFailed(msg)
|
||||
return user, None
|
||||
|
||||
def authenticate_header(self, request):
|
||||
return self.keyword
|
||||
|
||||
|
||||
class PrivateTokenAuthentication(authentication.TokenAuthentication):
|
||||
model = PrivateToken
|
||||
|
|
Loading…
Reference in New Issue