MCPcopy Create free account
hub / github.com/authlib/authlib / query_user_grant

Method query_user_grant

authlib/oauth2/rfc8628/device_code.py:162–178  ·  view source on GitHub ↗

Get user and grant via the given user code. Developers MUST implement it in subclass:: def query_user_grant(self, user_code): # e.g. we saved user grant info in redis data = redis.get("oauth_user_grant:" + user_code) if not data:

(self, user_code)

Source from the content-addressed store, hash-verified

160 raise NotImplementedError()
161
162 def query_user_grant(self, user_code):
163 """Get user and grant via the given user code. Developers MUST
164 implement it in subclass::
165
166 def query_user_grant(self, user_code):
167 # e.g. we saved user grant info in redis
168 data = redis.get("oauth_user_grant:" + user_code)
169 if not data:
170 return None
171
172 user_id, allowed = data.split()
173 user = User.get(user_id)
174 return user, allowed == "1"
175
176 Note, user grant information is saved by verification endpoint.
177 """
178 raise NotImplementedError()
179
180 def should_slow_down(self, credential):
181 """The authorization request is still pending and polling should

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected