openid / AppAuth-Android

Android client SDK for communicating with OAuth 2.0 and OpenID Connect providers.
https://openid.github.io/AppAuth-Android
Apache License 2.0
2.83k stars 883 forks source link

Set browser matcher to Mircosoft Edge #1004

Open khailenkomaksym opened 1 year ago

khailenkomaksym commented 1 year ago

I need to allow authentication only via Microsoft Edge. To do it, I need to restrict browser matcher only with Microsoft Edge browser information:

val MICROSOFT_EDGE_BROWSER = VersionedBrowserMatcher(
        "com.microsoft.emmx",
        "signature ???",
        false,
        VersionRange.ANY_VERSION)

private val appAuthConfiguration = AppAuthConfiguration.Builder()
        .setBrowserMatcher(
            BrowserAllowList(MICROSOFT_EDGE_BROWSER)
        ).build()

My question is about signature (The SHA-512 hash (Base64 url-safe encoded)) for Microsoft Edge browser. I see here: https://github.com/openid/AppAuth-Android/blob/master/library/java/net/openid/appauth/browser/Browsers.java the list of browsers that already have signature value, but how to get this signature key for others browsers, for example, Microsoft Edge? I'm wondering where these values were fetched for Chrome, Firefox, SBrowser browsers.