Giter VIP home page Giter VIP logo

Comments (10)

amitkumar3968 avatar amitkumar3968 commented on September 10, 2024

I think, after successful authentication, you have to hit your url through inappbrowser in ios.

from cordova-plugin-auth-dialog.

gfox1984 avatar gfox1984 commented on September 10, 2024

Actually I just used Fiddler to intercept the request. I can see that the required cookies are not set when I open the website in the iframe after authenticating.

from cordova-plugin-auth-dialog.

amitkumar3968 avatar amitkumar3968 commented on September 10, 2024

so, whats ur issue ?

from cordova-plugin-auth-dialog.

gfox1984 avatar gfox1984 commented on September 10, 2024

The user is not authenticated in the frame because the authentication cookies are not set in the frame.

More precisely, the issue occurs with a site that uses a STS. After the STS has authenticated the user, the server responds with a HTML page that contains a form with the user claims. That form normally gets posted back to the website using JavaScript, which then sets the required cookies.

This works well in Safari on iOS. It doesn't work with the plugin on the app. The reason I believe is that the STS requires that the HTML response is actually run to complete the authentication.

from cordova-plugin-auth-dialog.

amitkumar3968 avatar amitkumar3968 commented on September 10, 2024

@gfox1984 , what i implemented was, having a http url having ntlm authentication protection in it, so by using this plugin, after successful authentication, i opened the url via inappbrowser in ios app, and it worked.

Test url for http authentication.
http://httpbin.org/basic-auth/user/passwd

So, after authDialog.authenticate , you should try to open your STS url again.
it will not automatically open the url for us.

Try and let me know, if possible can you provide the STS url for testing.

from cordova-plugin-auth-dialog.

pallaviMN avatar pallaviMN commented on September 10, 2024

@gfox1984 , i am also facing same issue, can you please send me how to implement this

from cordova-plugin-auth-dialog.

gfox1984 avatar gfox1984 commented on September 10, 2024

@pallaviMN After authenticating, simply navigate to your site in the frame and it should work. We actually had a bug in our STS which was crashing due to bad cookies.

from cordova-plugin-auth-dialog.

pallaviMN avatar pallaviMN commented on September 10, 2024

i wanted to know, how to call the plugin in android & its not calling "willSendRequestForAuthenticationChallenge" in iOS

from cordova-plugin-auth-dialog.

gfox1984 avatar gfox1984 commented on September 10, 2024

@pallaviMN on Android you cannot and you don't need to call the "authDialog.authenticate". When first accessing a page which requires Basic/Digest/NTML authentication, the authentication popup will automatically show.
I'm not sure about "willSendRequestForAuthenticationChallenge" in iOS.

PS: beware than iOS caches your credentials. So if you've entered them once, you won't be able to reenter them and go through authentication. This could be why you seem not to be re-authenticating in your app. To force reauthentication, you can use the Phonegap-Cookies-Plugin to clear the cookies, combined with the undocumented "authDialog.logout()" method. Below is an example that ensures a clean logout:

                // Clear authentication settings
                if (typeof authDialog !== "undefined")
                    authDialog.logout();
                // Clear any residual cookies
                window.cookies.clear(function () {
                    // Redirect to the login page                    
                    })
                });

from cordova-plugin-auth-dialog.

sDaniel avatar sDaniel commented on September 10, 2024

There is no logout method for this version of the plugin. Some people have worked on stuff like that though:

pcjonkman@bb7a1c9

dually8@ec66bc9

from cordova-plugin-auth-dialog.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.