Can you use openID as a single sign-on for an iphone app?
Asked Answered
M

4

11

I'm looking to implement Single Sign On for a native iOS app whereby logging in with this single sign on gives the mobile device authenticated access to our private service in a fashion that is somewhat similar to oauth.

The marketing text on openid.net suggests that "OpenID is a safe, faster, and easier way to log in to web sites.". Emphasis on web sites.

So the question is: Is it reasonable to implement openID on a native mobile app, or is openID only for web sites.

I've been scouring the web and I'm not finding a way to fit openID in as my login option.

Meandrous answered 6/5, 2011 at 6:51 Comment(0)
P
4

The best way to do this seems to be to use a UIWebView and render a log in page from your site in it. Once the user logs in, they'll be redirected back to your site and have an auth cookie, which you can extract, store, and send on subsequent HTTP requests to the server.

See this, which has a sample code link at the bottom.

Pol answered 22/1, 2012 at 14:35 Comment(0)
E
1

OpenID sends its messages as a series of HTTP requests and responses. Your app and the openid provider must communicate to each other via HTTP post, and you will need to redirect the user to corresponding URLs, and have a URL for the user to be redirected back to. As such, you will probably find it difficult to integrate with your app.

Erk answered 6/5, 2011 at 12:3 Comment(2)
why would that be? you can either use an openid server with basic auth, or really just show a popup.Ares
It depends on whether you have the URLs available for RP yadis discovery and redirection for one thing. Also, the easiest way to get OpenID support for a given site is to use a CMS which has an OpenID plugin, such as drupal or wordpress. Trying to develop an OpenID relying party or provider that actually follows the specification well is difficult in itself.Erk
J
0

Derek Knight claims to have been experimenting with iOS and OpenID using the Janrain Engage iOS SDK. Although the github link he references no longer exists and he doesnt provide a complete and verified solution, he does offer an idea for how it might work.

OpenID and iOS development - gordonknight.co.uk

Janrain Engage for your iPad Apps

Joselynjoseph answered 7/5, 2011 at 20:53 Comment(0)
H
0

The accepted answer diminish the OpenID protocol. OpenID is a federated authentication protocol aiming simple SSO experience, its a web based protocol but it can be implemented if you design an authentication broker.

APPs share nothing, apps should never access anything but identity token and access token (if allow). here is a link to get you starter in the right path to build seems-less SSO in the mobile between apps regardless the app isolation level. https://www.pingidentity.com/developer/en/resources/napps-native-app-sso.html

Libraries: https://github.com/openid/AppAuth-iOS

https://github.com/openid/AppAuth-Android

Hispanicize answered 14/8, 2018 at 13:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.