How can I skip universal login and go directly into the social login page? I am following Django quick start guide.
I have found this configuration in https://community.auth0.com/t/how-to-skip-aut0-login-page-and-directly-redirect-in-to-social-login-site/28211/3?u=karunamay post
https://[tenant].auth0.com/authorize?
audience=[API Identifier]
&scope=openid+profile+email
&response_type=token
&client_id=[Client ID]&connection=[Connection name]
&redirect_uri=[Redirect URI]
&nonce=123
But confused about where to edit this.
Here is the Django code
class Auth0(BaseOAuth2):
"""Auth0 OAuth authentication backend"""
name = 'auth0'
connection='twitter'
SCOPE_SEPARATOR = ' '
ACCESS_TOKEN_METHOD = 'POST'
REDIRECT_STATE = False
EXTRA_DATA = [
('picture', 'picture'),
('email', 'email')
]
def authorization_url(self):
return 'https://' + self.setting('DOMAIN') + '/authorize'
# return f"https://{self.setting('DOMAIN')}/authorize?connection=twitter"
def access_token_url(self):
return 'https://' + self.setting('DOMAIN') + '/oauth/token'
def get_user_id(self, details, response):
"""Return current user id."""
return details['user_id']
def get_user_details(self, response):
# Obtain JWT and the keys to validate the signature
id_token = response.get('id_token')
jwks = request.urlopen(
'https://' + self.setting('DOMAIN') + '/.well-known/jwks.json')
issuer = 'https://' + self.setting('DOMAIN') + '/'
audience = self.setting('KEY') # CLIENT_ID
payload = jwt.decode(id_token, jwks.read(), algorithms=[
'RS256'], audience=audience, issuer=issuer)
return {'username': payload['nickname'],
'first_name': payload['name'],
'picture': payload['picture'],
'user_id': payload['sub'],
'email': payload['email']}