oauth2_client/client.py
def fetch_and_store_token(app):
    """
    Obtain a new token from auth provider and store in database. If unable to
    parse received data as an AccessToken - wait 2s and try to fetch again. If
    still unable - raise KeyError.

    Arguments:
        app (oauth2_client.models.Application): oauth application instance

    Returns:
        oauth2_client.models.AccessToken: access token

    Raises:
        KeyError:
    """
    token = fetch_token(app)
    token.save()
    log.debug('Fetched and stored %s', token)
    return token

    Obtain a new token from auth provider and store in database. If unable to
    parse received data as an AccessToken - wait 2s and try to fetch again. If
    still unable - raise KeyError.

    Arguments:
        app (oauth2_client.models.Application): oauth application instance

    Returns:
        oauth2_client.models.AccessToken: access token

    Raises:
        KeyError:
    
Obtain a new token from auth provider and store in database. If unable to
parse received data as an AccessToken - wait 2s and try to fetch again. If
still unable - raise KeyError.
Obtain a new token from auth provider and store in database . If unable to parse received data as an AccessToken - wait 2s and try to fetch again . If still unable - raise KeyError .
def fetch_and_store_token(app):
    token = fetch_token(app)
    token.save()
    log.debug('Fetched and stored %s', token)
    return token
def fetch_and_store_token ( app ) : token = fetch_token ( app ) token . save ( ) log . debug ( 'Fetched and stored %s' , token ) return token
Obtain a new token from auth provider and store in database.
Obtain a new token from auth provider and store in database .
"""
    Obtain a new token from auth provider and store in database. If unable to
    parse received data as an AccessToken - wait 2s and try to fetch again. If
    still unable - raise KeyError.

    Arguments:
        app (oauth2_client.models.Application): oauth application instance

    Returns:
        oauth2_client.models.AccessToken: access token

    Raises:
        KeyError:
    """
None
oauth2_client.models.AccessToken
None
KeyError
app
oauth application instance
oauth application instance