Skip to content
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

accessTokenEndpoint quirk with django backend #241

Open
zhutcho opened this issue Nov 14, 2023 · 1 comment
Open

accessTokenEndpoint quirk with django backend #241

zhutcho opened this issue Nov 14, 2023 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@zhutcho
Copy link

zhutcho commented Nov 14, 2023

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):

  • Android
  • iOS
@moberwasserlechner moberwasserlechner added the enhancement New feature or request label Dec 4, 2023
@moberwasserlechner
Copy link
Collaborator

TODO for myself: Check the urls for trailing / and add it if not exists while building the urls

@moberwasserlechner moberwasserlechner added this to the 5.1.0 milestone Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants