There are built in decorators that easily allow me to access Google's own services but how can I overload these decorators to call other endpoints, specifically Microsofts V2 Azure endpoint (I need to authenticate Office 365 users).
Code snippet which I would like to override to call other end points such as Microsofts:
https://login.microsoftonline.com/common/oauth2/v2.0/authorize
decorator = OAuth2Decorator(
client_id='d4ea6ab9-adf4-4aec-9b99-675cf46ad37',
redirect_uri='',
client_secret='sW8rJYvWtCBVpge54L8684w',
scope='')
class Authtest(BaseRequestHandler):
@decorator.oauth_required
Any ideas greatly appreciated. Thanks, Ian
Having wasted a lot of time on this I can confirm that you CAN overload the decorator to direct to the Azure V2 endpoint using the code below:
decorator = OAuth2Decorator(
client_id='d4ea6ab9-adf4-4aec-9b99-675cf46XXX',
auth_uri='https://login.microsoftonline.com/common/oauth2/v2.0/authorize',
response_type='id_token',
response_mode='form_post',
client_secret='sW8rJYvWtCBVpgXXXXX',
extraQueryParameter='nux=1',
state='12345',
nonce='678910',
scope=['openid','email','profile'])
Problem is that the decorators are coded purely to handle Google APIs and can not decode the response from Microsoft, whilst it may be possible to implement this myself by modifying the code in appengine.py it's too much work.
So if you are looking to authenticate to the Microsoft Azure V2 endpoint via Appengine it is not possible by using the built in OAuth2Decorator this only works with Google's own services.