Android 使用 MSAL 进行身份验证

Android Authentication using MSAL

我正在尝试使用 MSAL 为 Android 应用程序实施身份验证,但我不知道如何获得: enter link description here

我明白了,所以我需要为我的应用程序创建签名密钥 这里的说明 - enter link description here

我不明白如何实现它。如果有人有经验请帮助我

您遇到这种情况是因为您没有在 Android 应用程序的配置中添加 apk 的密钥。

在redirect_uri中,<YOUR_PACKAGE_NAME>部分指的是context.getPackageName()方法返回的包名。此包名称与 build.gradle 文件中定义的 application_id 相同。

NOTE: This is the minimum required configuration. MSAL relies on the defaults that ships with the library for all other settings. Refer to the configuration file documentation to understand the library defaults.

在这种情况下<YOUR_BASE64_URL_ENCODED_PACKAGE_SIGNATURE>。这是签名应用程序的密钥。 该值不能是静态的。您需要向 Microsoft 提供此应用程序正在针对真实应用程序进行身份验证。

registering your app in AAD之后会提示一个 keytool -exportcert -alias SIGNATURE_ALIAS -keystore PATH_TO_KEYSTORE | openssl sha1 -binary | openssl base64。通过此命令,您可以生成 android 密钥库密钥的签名。