Django rest framework and endpoints to use

31 views
Skip to first unread message

Shekar Tippur

unread,
Jun 8, 2015, 10:47:25 PM6/8/15
to django...@googlegroups.com
Hello,

I am trying to use OAuthSwift to get authenticated to my app running using rest framework.


Can you please indicate what URL I should be using to get myself validated. The api takes authorizeUrl, accessTokenUrl, and callback url 

  func doOAuthScreener(){

        let oauthswift = OAuth2Swift(

            //https://django-oauth-toolkit.readthedocs.org/en/latest/rest-framework/getting_started.html

            consumerKey:    Screener["consumerKey"]!,

            consumerSecret: Screener["consumerSecret"]!,

            authorizeUrl:   HERE

            accessTokenUrl: HERE, // This seem to be http://localhost:8000/o/token/

            responseType:   "code"

        )

        

        

        let state: String = generateStateWithLength(20) as String

        

        

        oauthswift.authorizeWithCallbackURL( NSURL(string: "HERE")!, scope: "user,repo", state: state, success: {

            credential, response, parameters in

            self.showAlertView("Screener", message: "oauth_token:\(credential.oauth_token)")

            }, failure: {(error:NSError!) -> Void in

                println(error.localizedDescription)

        })    


    }


Thanks,

Shekar

Reply all
Reply to author
Forward
0 new messages