Esempio n. 1
0
def oauth_request_token(request):
    """
    OAuth consumer initiate oauth flow by getting a request token
    """
    try:
        oauth_request, oauth_server = initialize_oauth(request)

        consumer_key = request.values.get("oauth_consumer_key", None)
        consumer = ConsumerApp.all().filter("consumer_key =", consumer_key).get()
        if not consumer:
            return Unauthorized()

        token = oauth_server.fetch_request_token(oauth_request)
        return Response(token.to_string(), content_type="application/x-www-form-urlencoded")
    except OAuthError, e:
        logging.debug(e)
        logging.debug(e.message)
        return BadRequest(e.message)
Esempio n. 2
0
def developer_apps(request):
    """
    Display the list of apps this user has created.
    """
    apps = ConsumerApp.all().filter("user ="******"core/developer/apps.html", {"apps": apps})