Example #1
0
def authorized(request):
    client = soundcloud_client.create_for_authorization(request.get_host())

    access_token = client.exchange_token(code=request.GET.get('code'))
    SessionManager.set_session(request, SessionManager.SOUNDCLOUD_ACCESS_TOKEN, access_token.obj)
    r = HttpResponse()
    r.write("<script>window.opener._authorized(); window.close();</script>")  # close the window for authorization
    return r
Example #2
0
def require_auth(request):
    client = soundcloud_client.create_for_authorization(request.get_host())
    return HttpResponseRedirect(client.authorize_url())