Open sjransom opened 2 years ago
Also for reference just adding the COROS response from their API spec:
{
"expires_in":2592000,
"refresh_token":"08a06b7df38d0d2852e5927c763f09d5",
"access_token":"db0214b6006e7570bd80b1894132b7bc",
"openId":"b93ac3b5df6b4db3be5477706689427e"
}
@sjransom matching the response described in https://www.oauth.com/oauth2-servers/access-tokens/access-token-response/ solved my problem.
I used skipCodeExchange: true
to resolve this error in config.
Using react-native-app-auth": "^7.1.0
In case someone is having this error with Dropbox.
I'm currently working on a Dropbox integration and I was facing this same issue on Android. My usecase needed a refresh_token
to be present in the response, which, according to the Dropbox documentation is filled in the response only when a token_access_type=offline
is provided.
Turns out the problem always happens, when I specify an additionalParameters
with the token_access_type
.
After some testings, the only configuration that seems to be working for my use case is :
const config = {
issuer : 'https://www.dropbox.com',
clientId: CLIENT_ID,
clientSecret: CLIENT_SECRET,
redirectUrl: 'com.my_com_id://oauth',
scopes: [],
serviceConfiguration: {
authorizationEndpoint: 'https://www.dropbox.com/oauth2/authorize?token_access_type=offline', //Notice the parameter here
tokenEndpoint: `https://www.dropbox.com/oauth2/token`,
}
// For the time being, don't use the additionalParameters to specify the "token_access_type"
//additionalParameters: {
// token_access_type:'offline'
//},
};
const authresult = await authorize(config);
Make sure to specify the token_access_type
in the authorizationEndpoint
.
Some more investigations are needed to know why the combination of additionalParameters
and token_access_type
didn't work.
Hi Team,
We are also facing the same issue in android physical device.We are using this lib to integrate with azure ADB2C.It would be great if we get any solution for the same.
Hi Team,
"react-native-app-auth": "^7.2.0", auth provider: ERP next (Frappe)
I'm facing the same issue when I omit skipCodeExchange: true, if I add it I'll get a response without code exchange. here is my config : config = { issuer: "https://site", skipCodeExchange: true, clientId: "sdfdsfads", clientSecret: "asdfdsf", redirectUrl: "com.myApp://oauthredirect, scopes: ["openid"], serviceConfiguration: { authorizationEndpoint: "https://site/.oauth2.authorize", //oauth/authorize tokenEndpoint: "https://site..oauth2.get_token", }, };
const authResult = await authorize(config); console.log("Auth State:", authResult);
I got to know the cause of the issue, I have debugged the lib and it is related to this ticket https://github.com/openid/AppAuth-Android/issues/233
any solution to this please help me
We are facing the same issue on Android. Anyone has any insights on how to resolve it?
I just had to add token_type: 'Bearer'
in the response my backend sends on the tokenEndpoint and now my app works on Android!
Issue
I am getting
JSON deserialization error
with the following on Android ONLY - iOS is working as expected.Response I am expecting (I got this via iOS as it works):
I have a hunch it's related to the
tokenAdditionalParameters
but I'm not 100% sure.Worth noting I can't see any network request to COROS using Flipper.
Environment
Android