oauth-apps-for-windows | OAuth for Apps : Samples for Windows | OAuth library
kandi X-RAY | oauth-apps-for-windows Summary
kandi X-RAY | oauth-apps-for-windows Summary
OAuth for Apps: Samples for Windows.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of oauth-apps-for-windows
oauth-apps-for-windows Key Features
oauth-apps-for-windows Examples and Code Snippets
Community Discussions
Trending Discussions on oauth-apps-for-windows
QUESTION
I'm in the process of understanding how to implement OAuth 2.0 native app the right way for Windows. And I've stumbled across this example written in C#. But this is what bugs me about this example:
...ANSWER
Answered 2021-Feb-05 at 19:48According to OAuth for Native Apps you should be able to register a static redirect URI like this:
- http://localhost/callback
Then at runtime you should be able to use various redirect URLs like this:
- http://localhost:8001/callback
- http://localhost:8002/callback
- http://localhost:8003/callback
I have rarely seen this supported though, and more commonly you need to register three or so specific URLs instead. You need to test for your provider to be sure.
QUESTION
I've followed a sample created here:
https://github.com/googlesamples/oauth-apps-for-windows/blob/master/OAuthDesktopApp/README.md
to have Google OAuth work with my desktop application and it seems I got stuck with redirect URIs. I know I have to provide a RedirectURI on Google Credentials page (in Developers Console), but I cannot figure out how to provide a RedirectURI to accept any port number.
In this sample, a local HTTP server opens a connection on localhost (127.0.0.1) and it seems to work, no matter which port is used for listening (it finds some random port and then sends RedirectURI as localhost:randomport) and authentication works as expected. However, when I try to do that in my application, I get notification that RedirectURI is not defined. Is there any special syntax to be used when defining RedirectURI inside Developer Console?
...ANSWER
Answered 2021-Jan-27 at 19:28As stated in the read me for the sample you are following
Create a new OAuth 2.0 client, select Other
You should have created a oauth2 client of type other, not an web application. the only difference really is that other is intended for desktop or native applications which use localhost by default as the redirect uri.
QUESTION
Using the OAuthDesktopApp example posted here: https://github.com/googlesamples/oauth-apps-for-windows , and converted to vb.net, there is a line of code which reads:
...ANSWER
Answered 2021-Jan-04 at 15:48From comments
QUESTION
I know this is a very basic question, but I'm creating a browser in wpf (I'm almost done with it) using CEFSharp, but I hit a snag with logging into google on some accounts. I get a "This browser or app may not be secure." message. Now, I've researched using OAuth to get a token for accessing and using certain features of Google, but not just how to log in as a whole. I just want the user to be able to log into Google, just like they would on a Chrome browser (without the Sync option, of course).
I registered my application with Google Console, and received a ClientId and ClientSecret, and I created a window to be called when the sign-in button is clicked on the google page that tries to get the token, but when the user types in their e-mail, they get the same message (See Below).
I'm not sure if there's an API that I can use or something that can let my user login to google through my browser without having to call the Google Chrome browser itself, because that defeats the purpose of my browser being self-sufficient. I've been beating my head on this for days. Can anyone help?
Below is the xaml for my Google Login window:
...ANSWER
Answered 2020-Jun-23 at 11:43You are trying to login on a web view and Google blocks that. Unfortunately, OAuth for desktop apps is tricky. I have some visual blog posts and a code sample you can run to understand behaviour:
- Login by invoking the system browser
- Receive the response by spinning up a loopback web server
- Or receive the response via a private URI scheme (my preference)
My samples are coded in Electron / Javascript. However, the below C# code samples accompany the IdentityModel security library, and I would recommend using this library for your app:
QUESTION
I am writing a windows desktop application with External Authentication(Google, Facebook) in C#.
I'm using HttpListener to allow a user to get Barer token by External Authentication Service with ASP.NET Web API, but administrator privileges are required for that and I want run without admin mode.
My reference was Sample Desktop Application for Windows.
Is this the best practice for external authentication provider from C#? Or is there another way to do that?
This is my code to get Barer token by external provider:
...ANSWER
Answered 2020-Mar-05 at 13:30I don't know about Facebook, but usually (I am experienced with Google OAuth2 and Azure AD as well as Azure AD B2C), the authentication provider allows you to use a custom URI scheme for the authentication callback, something like badcompany://auth
To acquire an authentication token I ended up implementing the following scheme (All code is presented without warranty and not to be copied thoughtlessly.)
1. Register an URI-handler when the app is startedYou can register an URI-Handler by creating a key in the HKEY_CURRENT_USER/Software/Classes
(hence no admin privileges needed) key in the Windows registry
- The name of the key equals the URI prefix,
badcompany
in our case - The key contains an empty string value named
URL Protocol
- The key contains a subkey
DefaultIcon
for the icon (actually I do not know whether this is necessary), I used the path of the current executable - There is a subkey
shell/open/command
, whose default value determines the path of the command to execute when the URI is tried to be opened, **please note*, that the"%1"
is necessary to pass the URI to the executable
QUESTION
To start - I have taken the sample UWP app provided by Google here (https://github.com/googlesamples/oauth-apps-for-windows/tree/master/OAuthUniversalApp).
I have this successfully working with my own clientID (which the setup was documented in the answer here: How to create a custom OAuth 2.0 redirect_uri for Google provider, for UWP app?). The redirect back into the app works fine - and is fired from the OnNavigatedTo() method in the sample.
I then have an UWP that logs temperature from a sensor (which will eventually run on a Raspberry Pi) - but for now I'm running this on normal Windows 10. I have copied the Oauth bits from the sample into my project - and also declared the protocol in the Package.appxmanifest using the name "pw.oauth2" (the same as the sample and also matches what I have in the Google Developer Console).
When I launch the app and click the "Sign in with Google" it successfully launches the browser, requests authorizations/sign-in, and redirects back to the app. I know this part is working because it brings the app back to the foreground. However the OnNavigatedTo() method is not firing when returning to my app.
I've search and read the documentation for this - but am unable to get that method to fire in my app. I feel like I missing something else that was setup in the sample app that I have not configured in my app. Any help or suggestions is appreciated!
Here is my XAML:
...ANSWER
Answered 2020-Jan-16 at 02:07Eventually solved this on my own - If you are following the Google provided Sample Oauth apps for UWP from link the in the question - you will need to add this method below to your App.xaml.cs class - this will get called when the redirect from Google opens your app. It then navigates to your main page which fires the code within the OnNavigatedTo() method.
QUESTION
Background on my login flow:
I'm creating a C# WPF Application which will be distributed to an end-user.
On my Website, I'm using FirebaseUI Auth to do the login authentication so that the user can log in with Google, Facebook or Email.
When the user initiates a log into the Application, it transfers the user over to the Website temporarily which mints a custom JWT token on the server which is returned to the Website then -> Application and then Application then uses to the freshly minted JWT token to Authenticate with FirebaseAuthentication.net to generate a Firebase auth token. This works great for connecting to Firebase REST API's like Firestore to obtain user information on client Application.
The Problem: Not only do I want to connect to the Firebase API's, but to the Google Cloud Speech API as well (in this case Speech-To-Text). I don't believe the Firebase auth token is sufficient to achieve this. I can verify the user and access their Firebase data on the server or the client, yet this is insufficient to connect to the Google Speech-To-Text API. In Google's examples using the client credentials first requires obtaining an auth-code from their authorization endpoint. In Google's Windows Application OAuth Example This is the https://accounts.google.com/o/oauth2/v2/auth authorization endpoint.
Theorizing creates another potential question which could sooner answer the question: Could I use my FirebaseUI Auth page as an OAuth Endpoint to somehow authenticate my End-User Application with Google to connect to the Google Speech-to-Text API instead of using the https://accounts.google.com/o/oauth2/v2/auth endpoint?
The Question: How do I access the Google Cloud Speech-To-Text API from an end-user Application after authenticating them with Firebase Auth?
Google's reference for how to authenticate as an end-user: https://cloud.google.com/docs/authentication/end-user
...ANSWER
Answered 2019-Sep-21 at 17:09Google Cloud Speech API auth needs to happen separately. You would need to enable this API from Cloud Console and create the service account key. Since this is an end user app I would recommend doing it on the server side. API integration examples are available in the Firebase GCP Integration Doc.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install oauth-apps-for-windows
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page