cdmvision / authentication-unity

OAuth 2.0 Client for Unity
MIT License
64 stars 16 forks source link

Can't make it work for UWP #10

Open hippogamesunity opened 1 year ago

hippogamesunity commented 1 year ago

Hi! I want my app to request a permission to Google Drive, so here is my working link to start auth. https://accounts.google.com/o/oauth2/auth?response_type=code&scope=https://www.googleapis.com/auth/drive&redirect_uri=ps.uwp%3A%2Foauth2callback&client_id=988157355771-r7j9rr6jf4cj7kn8de4pco4vtbbktmb9.apps.googleusercontent.com

I'm trying to use this project to perform auth, but DeepLinkBrowser simply opens https://accounts.google.com/o/oauth2/auth where I get "Required parameter is missing: response_type". Can you please point me to the right direction?

image

ibrahimpenekli commented 1 year ago

Hi @hippogamesunity ,

We use Application.OpenURL() to open the browser in DeepLinkBrowser implementation. https://github.com/cdmvision/authentication-unity/blob/1f2b2ab4adb9fde7f5a6922e4f2cb27fb79f597d/Packages/com.cdm.authentication/Runtime/Browser/DeepLinkBrowser.cs#L29

I don't know why it omits the query parameters from the url. Are you sure that it is omitted? Some browsers only displays the base url; you can see full url if you attempt to edit the url in the address bar.

ibrahimpenekli commented 1 year ago

Maybe because of this: https://answers.unity.com/questions/846108/applicationopenurl-wont-open-url-with-custom-strin.html