How do I sign up and log in to a remote web app from iOS?

What framework and classes would I need to use in iOS in order to sign up and log in to a web app on a remote server? I think I have to use a url session object, but how do I actually handle the user sign up and log in? Would I also need to use REST API?

Replies

how do I actually handle the user sign up and log in?

That depends on the server itself. For example:

  • If the server supports HTTP-style authentication (Basic, Digest, and so on), you’d handle that via the task authentication challenge mechanism.

  • If the server uses TLS mutual authentication, you’d handle that via the session authentication challenge mechanism.

  • Many web services require you to supply an API key via an HTTP header, a URL parameter, or in the HTTP body.

  • Many user-facing web sites authenticate using cookies.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

So what framework and classes do I need to use? I received an answer to use the URLSession class in a previous similar question I posted that was more narrowly defined than this question. Is that the only option to use for each of the answers you gave?

So what framework and classes do I need to use?

What authentication mechanism does this server use?

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

I am using REST API. The GET, to be exact.

I am using REST API.

Right, but that doesn’t explain how the server authenticates requests. If you want help implementing that authentication scheme, you’ll need to provide details on what that scheme is.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

I'm unfamiliar with what a scheme is.


I found this in this link: docops.ca.com/ca-single-sign-on/12-52-sp1/en/configuring/policy-server-configuration/authentication-schemes#AuthenticationSchemes-SupportedAuthenticationSchemesandPasswordPolicies. I'm new to this. I believe I need to use a password. Is there one you would recommend that would work well within an iOS context? I don't want the user interface to be a web browser.


The following table lists supported authentication scheme types and whether they support Password Policies.


Authentication Scheme TypeType Supports Password Policies?
AnonymousNo
BasicYes
Basic over SSLYes
CustomYes
HTML FormsYes
ImpersonationNo
OAuthNo
OpenIDNo
RADIUS CHAP/PAPYes
RADIUS ServerYes
SafeWordNo
SafeWord and HTML FormsNo
SecurIDNo
SecurID and HTML FormsNo
X.509 Client CertificateNo
X.509 Client Certificate and BasicYes
X.509 Client Certificate or BasicYes
X.509 Client Certificate and HTML FormsYes
X.509 Client Certificate or HTML FormsYes
Windows AuthenticationYes

I think it would be enough just to use a username and a password, without any sort of confirmation.

That table seems to indicate that the server supports HTTP Basic authentication. If so, you should be able to authenticate via the authenticate challenge mechanism. See Handling an Authentication Challenge.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"