How to authenticate iOS/iPhone users with remote web application and re-use authentication ticket in future requests to the same web application?

后端 未结 4 2054
无人及你
无人及你 2021-01-31 11:14

I am building an iOS application and I need to be able to make authenticated requests to a Rails 3 application for various bits of data. The Rails 3 application is using omniau

4条回答
  •  Happy的楠姐
    2021-01-31 11:45

    Using OAuth is pretty easy (well, easy is not the word...), but I made an iOS application and a java server that use OAUth as identity schema and, following the full cycle, finally I adquired a token that identifies this user and (as only can be accessed using signed requests) can be safely stored in the phone (I use just the standardUserDefaults to store it). Only your application (using the secret) can sign the requests.

    I don't know if this serves to you...

    Ah! After the identification via web, the browser redirect a special url (registered for my application) and the url opens my application including the token in its parameters, so it is easy to retrieve the token after the identification phase in handleOpenURL.

提交回复
热议问题