Open zhutcho opened 1 year ago
I spent a day trying to figure out why I was getting ERR_NO_AUTHORIZATION_CODE on iOS and ERR_AUTHORIZATION_FAILED on Android. It turns out I just needed to add a slash to the end of my accessTokenEndpoint URL e.g.
"https://dummyurl.com/oauth/token" became "https://dummyurl.com/oauth/token/"
Thought I'd post this in case someone else is running into a similar issue, as it's not immediately obvious.
@capacitor/cli: 4.8.1 @capacitor/core: 4.8.1 @capacitor/android: 4.8.1 @capacitor/ios: 4.8.1
4.0.2
Django
const oauth2Options = { appId: "clientID", authorizationBaseUrl: "https://dummyurl.com/oauth/authorize", accessTokenEndpoint: "https://dummyurl.com/oauth/token/", responseType: "code", redirectUrl: "dummyapp://oauth-callback", pkceEnabled: true, };
TODO for myself: Check the urls for trailing / and add it if not exists while building the urls
Description
I spent a day trying to figure out why I was getting ERR_NO_AUTHORIZATION_CODE on iOS and ERR_AUTHORIZATION_FAILED on Android. It turns out I just needed to add a slash to the end of my accessTokenEndpoint URL e.g.
"https://dummyurl.com/oauth/token" became "https://dummyurl.com/oauth/token/"
Thought I'd post this in case someone else is running into a similar issue, as it's not immediately obvious.
Capacitor version:
@capacitor/cli: 4.8.1 @capacitor/core: 4.8.1 @capacitor/android: 4.8.1 @capacitor/ios: 4.8.1
Library version:
4.0.2
OAuth Provider:
Django
Your Plugin Configuration
const oauth2Options = { appId: "clientID", authorizationBaseUrl: "https://dummyurl.com/oauth/authorize", accessTokenEndpoint: "https://dummyurl.com/oauth/token/", responseType: "code", redirectUrl: "dummyapp://oauth-callback", pkceEnabled: true, };
Affected Platform(s):