Skip to content

Commit 6c33521

Browse files
committed
Make it possible to extract extra data from the OpenIDResponse object
1 parent 7027acc commit 6c33521

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

velruse/providers/openid.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ def callback(self, request):
253253
sreg_resp=sreg.SRegResponse.fromSuccessResponse(info),
254254
ax_resp=ax.FetchResponse.fromSuccessResponse(info)
255255
)
256+
self._extract_extra_data(info, user_data)
256257
# Did we get any OAuth info?
257258
oauth = info.extensionResponse(
258259
'http://specs.openid.net/extensions/oauth/1.0', False
@@ -273,6 +274,13 @@ def callback(self, request):
273274
else:
274275
raise ThirdPartyFailure("OpenID failed.")
275276

277+
def _extract_extra_data(self, info, user_data):
278+
"""
279+
This function does nothing, but can be used in subclasses
280+
to extract extra information from the OpenIDResponse object
281+
"""
282+
pass
283+
276284

277285
class AttribAccess(object):
278286
"""Uniform attribute accessor for Simple Reg and Attribute Exchange

0 commit comments

Comments
 (0)