How to redirect from Yahoo to my IOS app after authentication?

后端 未结 2 1311
时光说笑
时光说笑 2020-12-31 18:15

I am working on an app where I have to use Yahoo account to login. I had gone through this link and followed the procedure as it was there.But I am unable to get back to my

2条回答
  •  囚心锁ツ
    2020-12-31 18:26

    I didn't work with the Yahoo! API yet, but in oauth it works like that:

    • Create an url scheme in your app. You can do that in the Info section of your project settings (URL types). Name the scheme whatever you want, for example your app id.

    • When you authenticate your app, you can pass a parameter named oauth_callback. Here you have to pass the name of the just created url scheme.

    This should be it - when the login is ok on the Yahoo side, it will try to open the app that is registered for the url scheme it got as callback parameter.

    UPDATE:

    From the Yahoo! API documentation - this is the call you do when requesting the oauth token somewhere in your code (I filled in your url scheme as the callback, this is how it should look like):

    https://api.login.yahoo.com/oauth/v2/  
      get_request_token?oauth_nonce=ce2130523f788f313f76314ed3965ea6  
      &oauth_timestamp=1202956957  
      &oauth_consumer_key=123456891011121314151617181920  
      &oauth_signature_method=plaintext  
      &oauth_signature=abcdef  
      &oauth_version=1.0  
      &xoauth_lang_pref="en-us"  
      &oauth_callback="JCzOzd44://"
    

    Of course the request should be signed.

提交回复
热议问题