Allura/allura/controllers/auth.py
def generate_access_token(self, _id):
        """
        Manually generate an OAuth access token for the given consumer.

        NB: Manually generated access tokens are bearer tokens, which are
        less secure (since they rely only on the token, which is transmitted
        with each request, unlike the access token secret).
        """
        consumer_token = M.OAuthConsumerToken.query.get(_id=bson.ObjectId(_id))
        if consumer_token is None:
            flash('Invalid app ID', 'error')
            redirect('.')
        if consumer_token.user_id != c.user._id:
            flash('Invalid app ID', 'error')
            redirect('.')
        request_token = M.OAuthRequestToken(
            consumer_token_id=consumer_token._id,
            user_id=c.user._id,
            callback='manual',
            validation_pin=h.nonce(20),
            is_bearer=True,
        )
        M.OAuthAccessToken(
            consumer_token_id=consumer_token._id,
            request_token_id=c.user._id,
            user_id=request_token.user_id,
            is_bearer=True,
        )
        redirect('.')

        Manually generate an OAuth access token for the given consumer.

        NB: Manually generated access tokens are bearer tokens, which are
        less secure (since they rely only on the token, which is transmitted
        with each request, unlike the access token secret).
        
Manually generate an OAuth access token for the given consumer.
NB: Manually generated access tokens are bearer tokens, which are
less secure (since they rely only on the token, which is transmitted
with each request, unlike the access token secret).
Manually generate an OAuth access token for the given consumer . NB : Manually generated access tokens are bearer tokens which are less secure ( since they rely only on the token which is transmitted with each request unlike the access token secret ) .
def generate_access_token(self, _id):
        consumer_token = M.OAuthConsumerToken.query.get(_id=bson.ObjectId(_id))
        if consumer_token is None:
            flash('Invalid app ID', 'error')
            redirect('.')
        if consumer_token.user_id != c.user._id:
            flash('Invalid app ID', 'error')
            redirect('.')
        request_token = M.OAuthRequestToken(
            consumer_token_id=consumer_token._id,
            user_id=c.user._id,
            callback='manual',
            validation_pin=h.nonce(20),
            is_bearer=True,
        )
        M.OAuthAccessToken(
            consumer_token_id=consumer_token._id,
            request_token_id=c.user._id,
            user_id=request_token.user_id,
            is_bearer=True,
        )
        redirect('.')
def generate_access_token ( self , _id ) : consumer_token = M . OAuthConsumerToken . query . get ( _id = bson . ObjectId ( _id ) ) if consumer_token is None : flash ( 'Invalid app ID' , 'error' ) redirect ( '.' ) if consumer_token . user_id != c . user . _id : flash ( 'Invalid app ID' , 'error' ) redirect ( '.' ) request_token = M . OAuthRequestToken ( consumer_token_id = consumer_token . _id , user_id = c . user . _id , callback = 'manual' , validation_pin = h . nonce ( 20 ) , is_bearer = True , ) M . OAuthAccessToken ( consumer_token_id = consumer_token . _id , request_token_id = c . user . _id , user_id = request_token . user_id , is_bearer = True , ) redirect ( '.' )
Manually generate an OAuth access token for the given consumer.
Manually generate an OAuth access token for the given consumer .
"""
        Manually generate an OAuth access token for the given consumer.

        NB: Manually generated access tokens are bearer tokens, which are
        less secure (since they rely only on the token, which is transmitted
        with each request, unlike the access token secret).
        """
self
_id