Giter VIP home page Giter VIP logo

cordova-plugin-auth-dialog's Introduction

Apache Cordova Auth Dialog

Adds support for authentication dialogs into Apache Cordova.

####Supported Platforms####

  • Android
  • iOS
  • Windows (includes Windows Phone 8.1)
  • Windows Phone 8.0

####Supported Authentication Methods####

  • Basic
  • Digest
  • NTLM

##Platform quirks##

####Android####

Pending the following PR to be merged and released to have this working: apache/cordova-android#143

No additional set up is required. Implementation is based on providing custom handler for [WebViewClient.onReceivedHttpAuthRequest](http://developer.android.com/reference/android/webkit/WebViewClient.html#onReceivedHttpAuthRequest(android.webkit.WebView, android.webkit.HttpAuthHandler, java.lang.String, java.lang.String)) which is automatically triggered when it is necessary during navigation or sending XmlHttpRequests.

Credentials are NOT persisted between app sessions so you need to enter them once per application start.

InAppBrowser plugin is NOT currently supported.

####iOS####

Requires manually executing the following method before accessing protected space (navigation or XmlHttpRequests).

authDialog.authenticate(uri, /*optional*/ successCallback, /*optional*/ errorCallback, /*optional*/ userName, /*optional*/ password, /*optional*/ maxAttempts)

Credentials are automatically cached by UIWebView so you do NOT need to enter them every app start. In this case authDialog.authenticate is executed w/o showing any credentials pop-up dialog.

After authentication is you can do XmlHttpRequests or display protected space via window.location = 'some protected uri' or using InAppBrowser plugin.

####Windows####

On Windows Tablet/PC (Windows 8.0 and Windows 8.1) native authentication dialog works out of the box so this functionality is not required (skipped).

On Windows Phone 8.1 authentication dialog is automatically showed for XmlHttpRequests only, InAppBrowser plugin is NOT currently supported.

Plugin overrides default XmlHttpRequest via custom wrapper based on original one to automatically show credentials dialog when it is necessary. Credentials dialog is html based and does not support hardware back button.

Credentials are NOT persisted between app sessions so you need to enter them once per application start.

####Window Phone 8.0####

Plugins supports XmlHttpRequests and opening protected space in Cordova View. InAppBrowser plugin is NOT currently supported.

Plugin overrides default XmlHttpRequest via custom wrapper based on original one to automatically show credentials dialog when it is necessary. Credentials dialog is XAML-based (native) and correctly supports hardware back button.

Credentials are NOT persisted between app sessions so you need to enter them once per application start.

There is a known issue with XmlHttpRequest to secured sites: When request receives a response with status 401 and "WWW-Authenticate" header, the whole Javascript layer freezes. This makes this plugin and XHR unusable for accessing resources that requires authentication on WP8 devices. However WP8.1 is not affected by this issue.

Copyrights

Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use these files except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

cordova-plugin-auth-dialog's People

Contributors

cjpearson avatar panarasi avatar sgrebnov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cordova-plugin-auth-dialog's Issues

This plugin do not work

In Android this plugin do not work. In iOs this plugin do not work.
No working example can be found on mobile.
How can we say that it is supported by all operating systems?

Support auth-dialog with inAppBrowser

Hi,

I'm interested in with your work. Now, I work with Windows Phone/Windows Phone 8.1. I don't know how to call auth-dialog for display a prompt username/password when the redirection url returned (with InAppBrowser may be).

Can you give me the devices, please ?

Thanks so much,

Nhat

Not working in Windows 10

Hi am getting error in Windows 10 device.

  • . "DEP6701 : Bootstrapping failed with unexpected error: 'The specified module could not be found."
  • . The type 'UserControl' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.
    (and 19 other errors.)

Waiting for the update...

Support with inAppBrowser

Hello team,

I am trying to use auth dialog with inappbrowser. This works fine in android version. unfortunately not working in IOS.

What I mean is when inappbrowser requests a page having basic authentication (windows based authentication) in Android i am able to see auth dialog correctly getting popuped up.

In IOS inappbrowser correctly loads the page but auth dialog is not getting invoked?

Is there anythiing i missed in cofiguration? Can someone help me with this in IOS please?

auth dialog on android

Hi ,
on iOS, it is working fine, but not able to run on android.
Though , the PR is merged for android.
Can you please update README for android for hitting the authdialog.

Thanks

Not working on latest IOS?

I'm building this in the latest cordova IOS targeting for ios 8 with xcode 8 but it just wont work... it works fine on android not really sure what todo do...

clear saved credentials

Hi Team,

As per ios, user credentials are saving in keychain.
there should be a method for removing them too.
And also for Android.
Can you tell , how they are saving in Android, as i have tried to clearcache, clear sharePreferences, but
they are still there. ?

Please check.

iframe navigation not authenticated on iOS

After successfully authenticating to a website using the plugin API, you are not able to navigate to the same website in an iframe on iOS (tested with iOS 9). Not sure whether it's a cookie issue...

This bug does not occur on Android.

compile fix...

I had to remove about 4 lines in the authdialog-strings.xml file that contained:
product="nosdcard"

this was the only way i could get it to compile for the android because it kept giving me duplicate string error during "cordova build android" phase. I could have probably troubleshot this but after removing the lines it compiled and it's running great so i guess i don't care.

How to observe success or error callbacks for windows authentication in Android?

Hi guys
Presently iam implementing Windows authentication to my Ionic Project in Android Platform.
Here iam Facing problem with identifying given credentials were succeded or not.

Presently when iam hit the URL its showing n popup window and asking user credentials, when i enter correct user credentials poup window disappear , i dont know whether it is succeded or not.

How to observe Success or Failure when user entered correct credentials in popup window

I have seen Android code there is no success or error callbacks in that.
For iOS there is stright forward solution
it wont ask poup window and we can able to listen success or error callbacks
So How to do similar kind of thing in Android also

Please suggest me if any one have solution for this
Thanks in advance

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.