Handle windows authentication in ionic apps

How to handle windows authentication in ionic apps instead of poup how to implement form based authentication
Note : If we hit server its getting 401 unautharized access. How to handle this
Thank you

1 Like

What do you mean by “windows authentication” exactly?
What do you mean by “popup”?
What do you mean by “foirm based authentication”?

“Handle” as in “Handle this in the app and display an error message” or “Handle” as in “How do I fix this”?

image

See when i hit one server like www.myserver.com it will show popup (means they integrated windows authenctication)
So in mobile also for same website they have created api(www.myserver.com/api/login) so in mobile will ask user to user name and passwrod
after that when iam calling this service its shwoing 401 unauherised access.
I know i think in server side they might bypass it solve, but here it is complex in my situations,
so here this cases how to overcome this 401 error and solve this?

and one more thing how to identify whether url has windowsauthentication enabled or not?

Thank you

No, this is called “Basic Authentication” and is a standard browser feature. You can also put the use and password in the URL: http://user:password@example.com to circumvent this popup (but will probably get other security questions from your browser).[quote=“Anil_Ionist, post:3, topic:89619”]
after that when iam calling this service its shwoing 401 unauherised access.
I know i think in server side they might bypass it solve, but here it is complex in my situations,
so here this cases how to overcome this 401 error and solve this?
[/quote]

How are you calling this API? Normally you just add a header with the authentication payload.

This is what iam trying


Here instead of url: ‘/signin’ iam adding (url:"www.myserverurl.com"
hedaers as dgAuthServiceProvider.setHeader(‘authenticate’);

This is totally wrong: This package is for AngularJS. You posted in the “Ionic” category which include Ionic 2 and 3 which is based on Angular - which is a totally different Javascript framework. This won’t work.

What is your code to request the API you are using right now that is getting the 401?

I am also looking for the same. How to handle window authentication in ionic 3?

Somebody solved this problem? Looking for ionic ntlm authentification.