iphone - http authentication in devise and rails 3 -


I have an application which is planning on Rail 3. I would like to enable HTTP Authentication so that I can authenticate my web app from an iPhone app

Is it safe or should I have a different authenticity?

From the design point view you get 3 options:

1) Basic Use HTTP authentication: Your iPhone app is a secret key - cooked in your iPhone app code - which uses the web app to authenticate each request Google Search: "Prepare Basic HTTP Authentication"

2) You have a public certificate in your iPhone app and a private server on your web app. You can use the https through Ifikets. It's a lot of work to configure properly, because your iPhone app and the rail server are exchanging messages on an encrypted channel, it's very safe. Authentication is done at the transport level, hence the security is also transparent for your railway code.

3) The iPhone app connects to the web app using https, receives an authentication token that it regularly uses to call the web app at http. 1, because the key may end, there is quite a lot more scalable for implementation.

To implement the HIP authentication (either basic or digest) I recommend that you will see.

At:

And

The exact steps will depend on your rail server stack.

EDIT 2: I do not think Devise provides a way to get AUTH_Token. I can see that you can try several solutions:

  • When the user logs in to the server, then retrieves the authentication_token and puts it in the cookie until you share it Do not encrypt with the secret key, until it is not very secure.

  • You can provide an https web service that uses your iPhone app to obtain a user token.

    Sorry, I can not do much more with actual code.

Comments

Popular posts from this blog

qt - switch/case statement in C++ with a QString type -

python - sqlite3.OperationalError: near "REFERENCES": syntax error - foreign key creating -

Python's equivalent for Ruby's define_method? -