77implementation and the standard OIDC implementation in Python Social Auth.
88"""
99
10- import logging
11-
1210from .open_id_connect import OpenIdConnectAuth
1311
14- logger = logging .getLogger ("social" )
15-
1612
1713class CASOpenIdConnectAuth (OpenIdConnectAuth ):
1814 """
@@ -33,25 +29,23 @@ class CASOpenIdConnectAuth(OpenIdConnectAuth):
3329
3430 def oidc_endpoint (self ):
3531 endpoint = self .setting ("OIDC_ENDPOINT" , self .OIDC_ENDPOINT )
36- logger . debug ( "backend: CAS, endpoint: %s" , endpoint )
32+ self . log_debug ( " endpoint: %s" , endpoint )
3733 return endpoint
3834
3935 def get_user_id (self , details , response ):
40- logger .debug (
41- "backend: CAS, method: get_user_id, details: %s, %s" , details , response
42- )
36+ self .log_debug ("method: get_user_id, details: %s, %s" , details , response )
4337 return details .get ("username" )
4438
4539 def user_data (self , access_token , * args , ** kwargs ):
4640 data = self .get_json (
4741 self .userinfo_url (), headers = {"Authorization" : f"Bearer { access_token } " }
4842 )
49- logger . debug ( "backend: CAS, user_data: %s" , data )
43+ self . log_debug ( " user_data: %s" , data )
5044 return data .get ("attributes" , {})
5145
5246 def get_user_details (self , response ):
5347 username_key = self .setting ("USERNAME_KEY" , self .USERNAME_KEY )
54- logger . debug ( "backend: CAS, username_key: %s" , username_key )
48+ self . log_debug ( " username_key: %s" , username_key )
5549 attributes = self .user_data (response .get ("access_token" ))
5650 return {
5751 "username" : attributes .get (username_key ),
0 commit comments