Esempio n. 1
0
def authorization_code_grant_step1(request):
    """
    Code grant step1 short-cut. This will return url with code.
    """
    django_request = oauth2_request_class()(request)
    grant = CodeGrant(oauth2_server, django_request)
    return grant.authorization()
Esempio n. 2
0
def authorization_code_grant_step2(request):
    """
    Code grant step2 short-cut. This will return access credential.
    """
    django_request = oauth2_request_class()(request)
    grant = CodeGrant(oauth2_server, django_request)
    credential = grant.get_credential(OAUTH2_SETTINGS.ACCESS_TOKEN_EXPIRATION)
    return credential