FormidableLabs / react-native-app-auth

React native bridge for AppAuth - an SDK for communicating with OAuth2 providers
https://commerce.nearform.com/open-source/react-native-app-auth
MIT License
2k stars 438 forks source link

Support for response mode is missing #917

Open paulschreiber opened 10 months ago

paulschreiber commented 10 months ago

Issue

Support for response mode is missing. If you try to add it as an additional parameter:

import {authorize} from 'react-native-app-auth';

const appleConfig = {
  issuer: 'https://appleid.apple.com',
  clientId: APP_CONFIG.appleClientId,
  redirectUrl: APP_CONFIG.appleRedirectURI,
  scopes: ['name', 'email'],
  additionalParameters: {
    response_mode: "form_post",
  }
};
let result = await authorize(appleConfig);

You get this error:

Parameter response_mode is directly supported via the authorization request builder, use the builder method instead

Please add a responseMode parameter to config. In RNAppAuthModule.java, use setResponseMode() to pass that on. A similar change is needed for iOS.

This may also require an upstream fix in net.openid.appauth.AuthorizationRequest to support form_post.

Related issues

Implement "form_post" response mode https://github.com/FormidableLabs/react-native-app-auth/issues/580 Has anyone used this lib for Apple Sign In (on Android)? https://github.com/FormidableLabs/react-native-app-auth/issues/484

Environment

paulschreiber commented 10 months ago

Upstream: https://github.com/openid/AppAuth-Android/issues/608