-
Notifications
You must be signed in to change notification settings - Fork 441
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
On some Android devices, the application crashes after passing the authentication procedure #600
Comments
In this case, the skipCodeExchange is null: if (this.skipCodeExchange) {
WritableMap map = TokenResponseFactory.authorizationResponseToMap(response);
if (promise != null) {
promise.resolve(map);
}
return;
} If you write a check that the skipCodeExchange is not null, then the following exception is thrown:
In this line: TokenRequest tokenRequest = response.createTokenExchangeRequest(this.additionalParametersMap); |
Perhaps the system closes the application during authentication, and after a redirect, the object is reinitialized with null parameters. It may be worthwhile to store the config in the repository. |
Any updates on this? |
I redid the work with authorization using WebView through my own solution, everything works |
I am experiencing the same issue (or at least it looks like the same):
Does anybody have any information on what might be the cause? The error happens during authentication and it happens only on Android. |
I am experiencing the same problem. Any updates on this? Thanks in advance! |
I am also seeing this issue. Would love some direction as I would be happy to provide a PR to help fix this. |
I've had this issue for several months. Any help would be greatly appreciated. |
I am with the same issue here. I think one of the Boolean variables should be a boolean type. |
I've tested version 6.4.0 but keep with the same issue |
We're also seeing this issue on our production app (react-native-app-auth version 6.4.0). Mainly on Huawei (P30 lite, P smart Z, Mate 20 lite, Y6 2019, Honor 10 lite) devices and budget Samsung (A50 and A32) devices |
We're also seeing the issue. For now only on Honor 8X (Android 10) react-native: 0.65.1
|
any updates on this ? experiencing this only on production app |
+1 seeing this in our React native project as well. |
I've also been experiencing this error. The strange thing is - I'm explicitly passing I don't see how this line 419 can be throwing an error considering this method invocation from the RN side: export const authorize = ({
issuer,
redirectUrl,
clientId,
clientSecret,
scopes,
useNonce = true,
usePKCE = true,
additionalParameters,
serviceConfiguration,
clientAuthMethod = 'basic',
dangerouslyAllowInsecureHttpRequests = false,
customHeaders,
additionalHeaders,
skipCodeExchange = false,
}) => {
validateIssuerOrServiceConfigurationEndpoints(issuer, serviceConfiguration);
validateClientId(clientId);
validateRedirectUrl(redirectUrl);
validateHeaders(customHeaders);
validateAdditionalHeaders(additionalHeaders);
// TODO: validateAdditionalParameters
const nativeMethodArguments = [
issuer,
redirectUrl,
clientId,
clientSecret,
scopes,
additionalParameters,
serviceConfiguration,
skipCodeExchange,
];
if (Platform.OS === 'android') {
nativeMethodArguments.push(useNonce);
nativeMethodArguments.push(usePKCE);
nativeMethodArguments.push(clientAuthMethod);
nativeMethodArguments.push(dangerouslyAllowInsecureHttpRequests);
nativeMethodArguments.push(customHeaders);
}
if (Platform.OS === 'ios') {
nativeMethodArguments.push(additionalHeaders);
nativeMethodArguments.push(useNonce);
nativeMethodArguments.push(usePKCE);
}
return RNAppAuth.authorize(...nativeMethodArguments);
}; And this method definition on the native side: @ReactMethod
public void authorize(
String issuer,
final String redirectUrl,
final String clientId,
final String clientSecret,
final ReadableArray scopes,
final ReadableMap additionalParameters,
final ReadableMap serviceConfiguration,
final Boolean skipCodeExchange,
final Boolean useNonce,
final Boolean usePKCE,
final String clientAuthMethod,
final boolean dangerouslyAllowInsecureHttpRequests,
final ReadableMap headers,
final Promise promise
) {
this.parseHeaderMap(headers);
final ConnectionBuilder builder = createConnectionBuilder(dangerouslyAllowInsecureHttpRequests, this.authorizationRequestHeaders);
final AppAuthConfiguration appAuthConfiguration = this.createAppAuthConfiguration(builder, dangerouslyAllowInsecureHttpRequests);
final HashMap<String, String> additionalParametersMap = MapUtil.readableMapToHashMap(additionalParameters);
// store args in private fields for later use in onActivityResult handler
this.promise = promise;
this.dangerouslyAllowInsecureHttpRequests = dangerouslyAllowInsecureHttpRequests;
this.additionalParametersMap = additionalParametersMap;
this.clientSecret = clientSecret;
this.clientAuthMethod = clientAuthMethod;
this.skipCodeExchange = skipCodeExchange;
this.useNonce = useNonce;
this.usePKCE = usePKCE;
... Unless there is more than one instance of I guess this is also what @Mishann is implying above:
@Mishann can you elaborate at all on this? 🙏 |
Still facing this issue on latest version of
|
Has anybody found a work around for this yet? |
Got the same problem on a Xiaomi Mi 8 Lite using Android 10. We are using react-native-app-auth at version 6.4.0. |
Did anyone solve this issue? |
This is the same issue as #672. It would be great if it was merged into official |
Closing and moving discussion to #743 as that captures the issue and links to the upstream repo. |
still crash for some android devices |
Issue
On some Android devices, the application crashes after passing the authentication procedure. Works correctly on most devices.
Config:
Error:
Environment
Keycloak
Android
no
The text was updated successfully, but these errors were encountered: