question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Process OAuth2 authorization on a mobile client and use credentials on a server?

See original GitHub issue

Is it possible to process OAuth2 authorization using a mobile SDK client and then use retrieved credentials with google-api-dotnet-client API? So, I want to get credentials directly in a mobile client, send them to a backend and use API on the backend with this credentials.
I already find something in source code: https://github.com/flutter/plugins/blob/master/packages/google_sign_in/google_sign_in/lib/google_sign_in.dart#L108 So, should I send to a backend only an access_token or it have to be something more?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
amanda-tarafacommented, Jul 30, 2021

Thanks @rodion-m , glad I could help.

If you wanted to perform authentication natively, you can follow the steps in OAuth 2.0 for Mobile & Desktop Apps. I’d still advise you to use a supported library or similar.

For Flutter, here are Flutter’s docs. And aslo you can ask a question on one of their repos, browse their samples there, etc… I won’t be able to help here since I’m not familiar with Flutter at all.

I’ll be closing this issue now, since there’s not much we can do on our side. Of course, if you encounter any problems with the Google.Apis.Auth library or with the approach suggested, do open new issues.

0reactions
rodion-mcommented, Jul 30, 2021

@amanda-tarafa Thank you very much for such a detailed response! I’m glad to see so high level of users supporting from Google! So, now only one problem is left - retrieving a refresh token using google_sign_in flutter plugin or at least find it in native library. Who should I ask this question?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using OAuth 2.0 for Web Server Applications | Authorization
Go to the Credentials page. Click Create credentials > OAuth client ID. Select the Web application application type. Fill in the form and...
Read more >
What is OAuth 2.0 and what does it do for you?
Authorization Code grant: The Authorization server returns a single-use Authorization Code to the Client, which is then exchanged for an Access Token. ·...
Read more >
What is OAuth and How Does it Work?
The OAuth 2.0 protocol defines four types of grants: Authorization Code, Client Credentials, Device Code and Refresh Token. The client then requests an...
Read more >
OAuth 2.0 Client Credentials Flow for Server-to- ...
In this flow, the client app exchanges its client credentials defined in the connected app—its consumer key and consumer secret—for an access token....
Read more >
OAuth 2.0 Authorization using Client Credentials
The authentication server authenticates the client using the client identifier issued to the client during the application registration process.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found