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

Edge browser support for Android #1083

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions library/java/net/openid/appauth/browser/Browsers.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,52 @@ private SBrowser() {
}
}

public static final class Edge {

/**
* The package name for edge.
*/
public static final String PACKAGE_NAME = "com.microsoft.emmx";

/**
* The SHA-512 hash (Base64 url-safe encoded) of the public key for edge.
*/
public static final String SIGNATURE =
"Ivy-Rk6ztai_IudfbyUrSHugzRqAtHWslFvHT0PTvLMsEKLUIgv7ZZbVxygWy_M5mOPpfjZrd3vOx3t-cA6fVQ==";

/**
* The set of signature hashes for Edge.
*/
public static final Set<String> SIGNATURE_SET =
Collections.singleton(SIGNATURE);

/**
* The version in which Custom Tabs were introduced in Edge.
*/
public static final DelimitedVersion MINIMUM_VERSION_FOR_CUSTOM_TAB =
DelimitedVersion.parse("45");

/**
* Creates a browser descriptor for the specified version of Edge, when used as a
* standalone browser.
*/
public static BrowserDescriptor standaloneBrowser(@NonNull String version) {
return new BrowserDescriptor(PACKAGE_NAME, SIGNATURE_SET, version, false);
}

/**
* Creates a browser descriptor for the specified version of Edge, when used as
* a custom tab.
*/
public static BrowserDescriptor customTab(@NonNull String version) {
return new BrowserDescriptor(PACKAGE_NAME, SIGNATURE_SET, version, true);
}

private Edge() {
// no need to construct this class
}
}

private Browsers() {
// no need to construct this class
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,15 @@ public class VersionedBrowserMatcher implements BrowserMatcher {
true,
VersionRange.atLeast(Browsers.SBrowser.MINIMUM_VERSION_FOR_CUSTOM_TAB));

/**
* Matches any version of SBrowser for use as a edge tab.
*/
public static final VersionedBrowserMatcher EDGE_CUSTOM_TAB = new VersionedBrowserMatcher(
Browsers.Edge.PACKAGE_NAME,
Browsers.Edge.SIGNATURE_SET,
true,
VersionRange.ANY_VERSION);

private String mPackageName;
private Set<String> mSignatureHashes;
private VersionRange mVersionRange;
Expand Down