Проблема в том, что я получаю исключение redirect_uri_mismatch.
Что я сделал:
Добавил https://example.com/.well-known/assetlinks.json с моим отпечатком отладки:
Код: Выделить всё
{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "com.mypackage.app",
"sha256_cert_fingerprints":
["FB:34:15:34:8F:6B:[...]"]
}
}]
Код: Выделить всё
Код: Выделить всё
val serviceConfiguration = AuthorizationServiceConfiguration(
Uri.parse("https://accounts.google.com/o/oauth2/v2/auth"), // Authorization endpoint
Uri.parse("https://www.googleapis.com/oauth2/v4/token") // Token endpoint
)
val redirect = "https://example.com"
val authRequestBuilder = AuthorizationRequest.Builder(
serviceConfiguration, // the authorization service configuration
GOOGLE_CLIENT_ID, // the client ID
ResponseTypeValues.CODE, // the response_type value: we want a code
Uri.parse(redirect)) // the redirect URI to which the auth response is sent
val authRequest = authRequestBuilder
.setScope("openid email profile")
.setState(state)
.build()
val authService = AuthorizationService(this)
// An Intent that will handle the redirect result
val redirectIntent = Intent(this, SignUpActivity::class.java)
.setAction(redirect)
authService.performAuthorizationRequest(
authRequest,
PendingIntent.getActivity(this, 0, redirectIntent, PendingIntent.FLAG_IMMUTABLE)
)
Код: Выделить всё
adb shell am start -a android.intent.action.VIEW \
-c android.intent.category.BROWSABLE \
-d "http://example.com"
Подробнее здесь: https://stackoverflow.com/questions/793 ... i-mismatch
Мобильная версия