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

Bug: Not able to read code in IOS #92

Closed
tinahir opened this issue Apr 26, 2020 · 3 comments
Closed

Bug: Not able to read code in IOS #92

tinahir opened this issue Apr 26, 2020 · 3 comments

Comments

@tinahir
Copy link

tinahir commented Apr 26, 2020

Capacitor version:

Latest Dependencies:

@capacitor/cli: 2.0.1
@capacitor/core: 2.0.1
@capacitor/android: 2.0.1
@capacitor/electron: 2.0.1
@capacitor/ios: 2.0.1

Installed Dependencies:
@capacitor/electron not installed
@capacitor/cli 2.0.1
@capacitor/core 2.0.1
@capacitor/ios 2.0.1
@capacitor/android 2.0.1

Library version:

  • 2.0.0

OAuth Provider:

  • Other: (Salesforce)

Your Plugin Configuration

{
   ios: {
        appId:'xxx',
        responseType: 'code',
        redirectUrl: 'myapp://oauth/',
        scope: 'api id web refresh_token',
        accessTokenEndpoint: 'xxxxx',
      },
}

Affected Platform(s):

  • iOS

Current Behavior

Not able read the "code" from URLevent if code is available in URl please check below log

Other Information

log:

{"iosSourceApplication":"com.apple.SafariViewService","url":"myapp://oauth/?code=aPrxI_ssdsdsdsdssdsdMHl1WjMBOJmM8s.froERJSun6dM7YN5EGAxSvy0oqV0FSFL33KIg%3D%3D&state=mKQ2VrcoxkyhAaXKH9FM&
⚡️ [log] - App opened with URL: myapp://oauth/?code=aPrxI_shXQqE3OxcxcxcxccM_rwWU02MHl1WjMBOJmM8s.froERJSun6dM7YN5EGAxSvy0oqV0FSFL33KIg%3D%3D&state=mKQ2VrcoxkyhAaXKH9FM&sfdc_community_url=https%3A%2F%2Fbmpdev-sigep.cs124.force.com%2FBMP&sfdc_community_id=0DB3J0000008OMCWA2
@byteowls/capacitor-oauth2: Authorization failed with The operation couldn’t be completed. (OAuthSwiftError error -11.).
ERROR MESSAGE: {"message":"ERR_NO_AUTHORIZATION_CODE","errorMessage":""}
⚡️ [error] - OAuth rejected {"message":"ERR_NO_AUTHORIZATION_CODE","errorMessage":"","line":224,"column":23,"sourceURL":"user-script:2"}

@moberwasserlechner moberwasserlechner added the duplicate This issue or pull request already exists label Apr 26, 2020
@moberwasserlechner
Copy link
Collaborator

This is known see #13

@moberwasserlechner
Copy link
Collaborator

@tinahir What I though before might be not right, therefore a few more question.

What do you want to achieve?

a) If you want to get only the code, that would be not possible on iOS because of #13
b) Full code flow. Try setting pkceEnabled to true because a real code flow is not support, as storing secrets on the client is a bad idea.

Does it work on other platforms?

I have no experience with Salesforce so I need as much information as you can get me, please try to debug ios.

@moberwasserlechner moberwasserlechner added needs-reply The author needs to reply to questions. Task will be closed after 5days if not answered. and removed duplicate This issue or pull request already exists labels Apr 28, 2020
@moberwasserlechner
Copy link
Collaborator

Closing as user not replied.

@moberwasserlechner moberwasserlechner added invalid This doesn't seem right and removed needs-reply The author needs to reply to questions. Task will be closed after 5days if not answered. labels May 3, 2020
@moberwasserlechner moberwasserlechner added Provider: Salesforce and removed invalid This doesn't seem right labels May 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants