Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix AuthenticationDialog crash; Add support for testing Authenticatio… #1254

Merged
merged 6 commits into from
Jul 19, 2018

Conversation

shoatman
Copy link
Contributor

@shoatman shoatman commented Jul 18, 2018

…nDialog to automation app; Add stress test to automation test app; Add web view open to automation test app

This closes #1234

…nDialog to automation app; Add stress test to automation test app; Add web view open to automation test app
Copy link
Contributor

@kreedula kreedula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @shoatman. Requesting minor changes and nits.

import android.webkit.WebView;
import android.webkit.WebViewClient;

public class CustomWebViewClient extends WebViewClient {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious why a CustomWebViewClient if we are just returning false from shouldOverrideUrl

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

False indicates that the webview itself handles the redirect. Which is fine in this case.

@@ -128,6 +145,12 @@ private void launchAuthenticationInfoActivity(int flowCode) {
this.startActivity(intent);
}

private void openWevViewActivity(){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo : openWebViewActivity

@@ -128,6 +145,12 @@ private void launchAuthenticationInfoActivity(int flowCode) {
this.startActivity(intent);
}

private void openWevViewActivity(){
final Intent intent = new Intent();
intent.setClass(mContext, WebViewActivity.class);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit : we can use Intent's constructor to set class and context directly like

final Intent intent = new Intent(mContext, WebViewActivity.class);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll fix since I'm fixing the typo

@@ -148,9 +156,19 @@ private void performAuthentication() {
validateUserInput(inputItems, flowCode);

setAuthenticationData(inputItems);
AuthenticationSettings.INSTANCE.setUseBroker(true);
AuthenticationSettings.INSTANCE.setUseBroker(mUseBroker);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had the same change which went in. Conflict needs to be resolved here

@iambmelt
Copy link
Member

Nothing further to add to @kreedula at this time

@kreedula
Copy link
Contributor

Thanks @shoatman. LGTM 👍

@iambmelt
Copy link
Member

iambmelt commented Jul 19, 2018

Linking to related items.

Original issue: #908
Original PR: #948

Related: #888, #906

Alternative 'fix' proposed by @iambmelt: #1094

Closes: #1234

@shoatman shoatman merged commit 66b8ab9 into dev Jul 19, 2018
@iambmelt
Copy link
Member

Related: #1261

@iambmelt iambmelt deleted the shoatman-AuthDialogFixes branch August 1, 2018 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dialog version of AuthenticationContext.acquireToken() causes subsequent non-ADAL Chromium webviews to throw
3 participants