Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 770
Roderic Campbell Avatar asked May 06 '11 06:05

Roderic Campbell


People also ask

Can OpenID be used for SSO?

OpenID is a standard added on the top of Oauth 2.0 (Authorization Protocol) framework which adds ID Token to access token in OAuth 2.0. OAuth and OpenID both act as Single Sign-On (SSO) standards. OpenID must be in JWT(JSON) data format.

Does SSO work on mobile?

The Mobile SSO processChrome custom tabs for Android and ASWebAuthenticationSession for iOS. The SSO solution is based on using these web controllers to allow the user to access the shared session that exists in the System Browser.

What is SSO single sign-on iOS?

Organisations often make use of Single sign-on. (SSO), which is designed to improve the users' sign-in experience to apps and websites. With SSO, a common authentication process is used to access multiple apps or systems — without the user asserting their identity again.


2 Answers

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.

like image 95
Eliot Avatar answered Oct 20 '22 21:10

Eliot


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.

like image 36
Jacob Bellamy Avatar answered Oct 20 '22 21:10

Jacob Bellamy