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

Example can't authorize success. #144

Closed
weberlisper opened this issue Sep 10, 2021 · 8 comments
Closed

Example can't authorize success. #144

weberlisper opened this issue Sep 10, 2021 · 8 comments
Labels
bug Something isn't working

Comments

@weberlisper
Copy link

I create a project in crowdin, and replace distributionHash, sourceLanguage, clientId, clientSecret in SceneDelegate.swift file. After I run the Example, and click "Log in" but authorize failed. the status code is 401, and the error message is "Client authentication failed".
I use the same configuration in android sample, but success.

@weberlisper weberlisper added the bug Something isn't working label Sep 10, 2021
@denisqua
Copy link

denisqua commented Sep 10, 2021

Hi @weberlisper !

I'm sorry for the issue you've faced with!

Please check the clientId, clientSecret and redirect URL in OAuth configuration on Crowdin.

Redirect URL should match your App scheme. For example, for <data android:scheme="crowdintest" /> redirect URL in Crowdin should be crowdintest://

Also, if you are using crowdin.com, not Crowdin Enterprise, organization_name in the SDK config should be null.

If after that, it still won't work, please provide the next details:

  1. short recorded video with all steps to reproduce
  2. your SceneDelegate.swift file (config file)
  3. project URL

@denisqua
Copy link

I personally have assumption that the root is a redirect URL (it should be crowdintest://) or you may try as on my screenshot:

3

@weberlisper
Copy link
Author

I personally have assumption that the root is a redirect URL (it should be crowdintest://) or you may try as on my screenshot:

3

This is my redictURL:
image
And I copy crowdintest:// in SceneDelegate.swift file, but got error:
image

@weberlisper
Copy link
Author

I personally have assumption that the root is a redirect URL (it should be crowdintest://) or you may try as on my screenshot:

3

I try your screenshot, but failed:
image

@weberlisper
Copy link
Author

@denisqua Hello

@denisqua
Copy link

denisqua commented Sep 10, 2021

Let's go answer by answer:

  1. >And I copy crowdintest:// in SceneDelegate.swift file, but got error:

According to that one, seems it isn't necessary to have crowdintest:// in the SceneDelegate.swift file:
https://github.com/crowdin/mobile-sdk-ios/blob/master/Example/AppleReminders/SceneDelegate.swift

So I kindly ask to remove it from the SceneDelegate.swift file (and do everything according to the documentation)

  1. >I try your screenshot, but failed:

Between first and second URLs I have coma, you put dot :)

but anyway, seems it's needed only crowdintest://

  1. Please, let me know whether you've added URL Scheme into Info.plist file:
    https://developer.apple.com/documentation/xcode/defining-a-custom-url-scheme-for-your-app

If after removing callback from the config file and setting up URL Scheme inside info.plist file it won't work, I kindly ask you:

  • record short video with all steps to reproduce (it helps to investigate the root of the issue)
  • share your full SceneDelegate.swift file (I see screenshot, but I'm not sure whether it's full, sensitive data could be hidden, of course)
  • project URL

@weberlisper
Copy link
Author

Let's go answer by answer:

  1. >And I copy crowdintest:// in SceneDelegate.swift file, but got error:

According to that one, seems it isn't necessary to have crowdintest:// in the SceneDelegate.swift file:
https://github.com/crowdin/mobile-sdk-ios/blob/master/Example/AppleReminders/SceneDelegate.swift

So I kindly ask to remove it from the SceneDelegate.swift file (and do everything according to the documentation)

  1. >I try your screenshot, but failed:

Between first and second URLs I have coma, you put dot :)

but anyway, seems it's needed only crowdintest://

  1. Please, let me know whether you've added URL Scheme into Info.plist file:
    https://developer.apple.com/documentation/xcode/defining-a-custom-url-scheme-for-your-app

If after removing callback from the config file and setting up URL Scheme inside info.plist file it won't work, I kindly ask you:

  • record short video with all steps to reproduce (it helps to investigate the root of the issue)
  • share your full SceneDelegate.swift file (I see screenshot, but I'm not sure whether it's full, sensitive data could be hidden, of course)
  • project URL

Thank you very much. It works!

@denisqua
Copy link

@weberlisper you're welcome as always!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants