Auto authentication in webview for iOS App


(Rahul Mayani) #1

Hi,
I’m implementing in an iOS app using the web view instance.
This is the scenario:

  • When the mobile app starts for the first time I create a user on my discourse instance by calling the API by setting active=true.

  • I use the username and password in the mobile app after successful creation.

[[challenge sender] useCredential:[NSURLCredential credentialWithUser:@“username” password:@“password” persistence:NSURLCredentialPersistencePermanent] forAuthenticationChallenge:challenge];

  • When the navigate web view controller starts I want to automatically login the user to discourse and show him the home page with the login done.

Can someone point me where can I find the solution?