Is it possible to have a native view which can use authentication apis for a website to login and then continue using rest of the web application using webview.
Is it possible to have a native view which can use authentication apis for a website to login and then continue using rest of the web application using webview.
Above @RAGHVENDERKATARIA explain in detail is right but you have to be also read Apple guidelines before developing this kind of App. If you have a look at the Apple guidelines it states:
it seems like you just made an app that encapsulated an UIWebView to load a specific page since you can do that via Safari, they reject apps like that.
Apps that are not very useful, unique, are simply web sites bundled as Apps, or do not provide any lasting entertainment value may be rejected
Logic on Native App:
You can just have a native view where you can let the user authenticate using APIs by entering username and password. On successful authentication you will get Bearer token and refresh token in response of the API.
Logic on Website:
Website should be implemented in such a way that it may accept refreshtoken in querystring which can be passed from anywhere, may it be native app or any place. Also there must be a Bearer token which carries the information of User like UserID, Name, Email etc. but all in encrypted form which can only be decrypted from server and this token may be stored in cookies of browser.
Now once querystring has refreshtoken, this refreshtoken can be exchanged from server in lieu of Bearer token and most important is that it can be exchanged only once, after that it will be invalid. Once bearer token is obtained from API, it can be written in browser cookies.
Website should see that if bearer token is present in cookies, then it should show that particular user in logged in state and rest of the functionality can continue on website for that user.
Summary
Login the user from Native app and obtain refresh token
Pass this token to your website querystring in webview
Exchange refreshtoken for Bearer token
Write this bearer token to website cookies.
Note:- Website would pick this cookie and show the user in logged in state.