@@ -68,11 +68,16 @@ def __init__(self):
68
68
# The authorization server has its own settings, but they are standardized
69
69
self .metadata = collectMetadata ()
70
70
self .metadata .validate ()
71
- # args for authlib < 1.0.0: (query_client=self.query_client, save_token=None, metadata=self.metadata)
72
- _AuthorizationServer .__init__ (self , scopes_supported = self .metadata ["scopes_supported" ]) # for authlib >= 1.0.0
73
- self .save_token = lambda x , y : None # Skip original unused authlib method
74
- self .send_signal = lambda * x , ** y : None # Skip original unused authlib method
75
- # the main method that will return an access token to the user (this can be a proxy)
71
+ # Initialize AuthorizationServer
72
+ _AuthorizationServer .__init__ (self , scopes_supported = self .metadata ["scopes_supported" ])
73
+ # authlib requires the following methods:
74
+ # The following `save_token` method is called when requesting a new access token to save it after it is generated.
75
+ # Let's skip this step, because getting tokens and saving them if necessary has already taken place in `generate_token` method.
76
+ self .save_token = lambda x , y : None
77
+ # Framework integration can re-implement this method to support signal system.
78
+ # But in this implementation, this system is not used.
79
+ self .send_signal = lambda * x , ** y : None
80
+ # The main method that will return an access token to the user (this can be a proxy)
76
81
self .generate_token = self .generateProxyOrToken
77
82
# Register configured grants
78
83
self .register_grant (RefreshTokenGrant ) # Enable refreshing tokens
0 commit comments