Click here to Skip to main content
15,893,588 members
Everything / OAuth2

OAuth2

OAuth2

Great Reads

by Uzi Granot
The attached open source C# .NET library is an SMTP client implementing implicit SSL and OAuth2 protocols. The library answers the question: how to send email message using Gmail as a server. Or, how to send email message using email server that implements implicit SSL and port 465.
by Livio Francescucci
Use a JWTToken to access a .NET Core Web API leveraging IdentityServer4 / OAuth2.
by Akkilz
How to generate Jwt security token for Application pool identity or logged on user using OAuth 2 from ADFS
by adriancs
Integrate Google OAuth 2.0 with ASP.NET in C# for seamless user authentication

Latest Articles

by adriancs
Integrate Google OAuth 2.0 with ASP.NET in C# for seamless user authentication
by Alessandro Magistroni
Oauth2 Client with IdentityModel.AspNetCore
by Kelum W. Ganegoda
Step-by-step approach to configure popular development tool Postman to test/execute Infor ION API
by Chris_Green
It all started with an email sent to a daemon.  A windows service hosting two modules, each of which monitors an inbox for automation, dutifully ignored warnings from IT that basic authentication for O365 would be switched off in several months. This is how we solved it.

All Articles

Sort by Score

OAuth2 

20 Jun 2019 by Uzi Granot
The attached open source C# .NET library is an SMTP client implementing implicit SSL and OAuth2 protocols. The library answers the question: how to send email message using Gmail as a server. Or, how to send email message using email server that implements implicit SSL and port 465.
11 Jun 2017 by Livio Francescucci
Use a JWTToken to access a .NET Core Web API leveraging IdentityServer4 / OAuth2.
13 Mar 2017 by Akkilz
How to generate Jwt security token for Application pool identity or logged on user using OAuth 2 from ADFS
18 Jan 2024 by adriancs
Integrate Google OAuth 2.0 with ASP.NET in C# for seamless user authentication
22 Jan 2015 by Mohan Gopi
Maybe can be useful to somebody, I found the answer here: You will get the Solution if you refer the the follwing links......
20 May 2020 by MadMyche
I would recommend that you read through the following page and verify that you have everything set up correctly; sounds like the MailKit sample code may not be the same as Google provides MailKit Issue #962: AuthenticationException 334[^] It...
17 Jul 2023 by Richard MacCutchan
You were given some suggestions in your previous question on this subject at: How to secure my C++ API?[^]. Quote: Is there an example I could find on the internet Quite possibly; try asking one of the many search engines available.
2 Apr 2014 by Guruprasad.K.Basavaraju
You could get the details from the Authentication result object.See belowAuthenticationResult userLoginDetails = OAuthWebSecurity.VerifyAuthentication(Url.Action("ExternalLoginCallback", new { ReturnUrl = returnUrl }));string emailOrUserID= userLoginDetails.UserName;string...
8 Jan 2018 by Programming Tutorials by Tests4Geeks
When building modern and socially-aware web applications, the related problems of user authorization and authentication arise repeatedly.
15 Nov 2019 by MadMyche
I would look into using the LinkedIn API, which is well documented by MicroSoft: Share on LinkedIn - LinkedIn | Microsoft Docs[^]
20 May 2020 by Garth J Lancaster
The 334 indicates an authentication error of some kind - I'd have expected extra information in the response alluding to the exact problem
22 Sep 2022 by Chris_Green
It all started with an email sent to a daemon.  A windows service hosting two modules, each of which monitors an inbox for automation, dutifully ignored warnings from IT that basic authentication for O365 would be switched off in several months. This is how we solved it.
5 Dec 2022 by Richard Deeming
Rather than reinventing the wheel, use the Microsoft Authentication Library to get your OAuth2 tokens: Learn about MSAL - Microsoft Entra | Microsoft Learn[^] In this case, it looks like you want to use the "Username/password (ROPC)" flow:...
17 Dec 2022 by Kelum W. Ganegoda
Step-by-step approach to configure popular development tool Postman to test/execute Infor ION API
28 Sep 2023 by Richard Deeming
res.redirect(authUrl); Your AuthPage endpoint is redirecting to https://sso-Myauthserver.com/as/authorization.oauth2. You would need to set up the appropriate CORS headers on that site to allow your JavaScript code to connect to it. However,...
11 Mar 2014 by shanalikhan
Hi , Is there any way that when use log in to my application i can easily get the result that he is a regular user of that profile and he has posted 50 posts last months.Using asp.net mvcThanks
13 Apr 2014 by Banci Gurjar
Importing contacts from Gmail stopped, i don't know when exactly, but it was working fine, in yahoo i changed HTTP to HTTPS and it is working now, i just want to know if there is any update by gmail with OAuth library, i am using following libraries.DotNetOpenAuth.dll ...
16 May 2014 by Camasutrinho
Hi,I'm trying to develop web app using Visual Studio 2013 and MVC pattern. I hope I've choosen good forum.I want to enable on my web app oath authentication system. I followed EXCACTLY every step decribed in Microsoft's tutorial. Unfortunetly, despite I did NOTHING else in my project,...
15 Jan 2017 by member33
Hello I was looking for simple example of implementing oauth2 in wcf rest service... all i could find are of with very complex examples.Thank you
20 Aug 2014 by sashafencyk
Hi. Yes i had the same problem as u!.. Look on this Article. it's helped me!
2 Sep 2014 by Abhinav S
You can do it yourself with pure JavaScript - try JavaScript oAuth[^].This is an opensource package available on GIT - https://github.com/oauth-io/oauth-js[^]. Note: I never triad it myself and so am not sure about how it will turn out!
5 Sep 2014 by suchithm
I need to integrate google login to android xamarin application. gone through the code from bellow link: http://motzcod.es/post/67077106339/google-plus-services-login-and-1-in-xamarin-androidit shows the error connection failed and [GooglePlayServicesUtil] Google Play Store is missing. even...
9 Sep 2014 by Akhil Mittal
I need to perform OAuth open authentication in MVC4 web site .I have tried it with the existing MVC4 template in Visual Studio 2013 Express.But I need to perform the authentication with my own custom database having users table already exists.In MVC template the class used was...
13 Sep 2014 by pinankshah
Hi,I am using OAuth 2.0 with template which comes with DotNet 4.0 framework. I have also created GoogleCustomClient Class (public class GoogleCustomClient : OpenIdClient) which has 2 methodsprotected override Dictionary GetExtraData(IAuthenticationResponse response)protected...
18 Nov 2014 by thuanbao15
I have link example error 404.: http://demo2.isb.vn/signin-google?state=PjzQ-AN12cQx6BdQGZbBlhtpXazTTTVxfFjlMnOJ9fxjEY_YrBzAeBjM4LkeVYnkgGcfONOapU1AjvqBm2m40iSnfiYd5YbX-Krb0KgQIv27Yf4MI0_n_ULf_Gc_ZxVCc.......................&prompt=noneBut running on localhost does not happen error
4 Dec 2014 by rothmichi
Hi,i'm a little bit despaired. I try to use the google DriveApi v2 to upload a file. However i'm not able to authenticate via oAuth2. I tried nearly every pice of code that i could found. If i execute the AuthorizeAsync Function i get an exception "No Application found". What is my mistake?...
4 Dec 2014 by harry madaan
Hello,I'm trying gmail login on my website. i used Oauth2 for this.http://www.idiotminds.com/sign-in-with-google-account-using-oauth2-0/Here process is working fine but i don't getting any data from the service like username , email etc. no any data is returning for...
7 Dec 2014 by harry madaan
Hello, I'm trying gmail login on my website. i used Oauth2 for this.http://www.idiotminds.com/sign-in-with-google-account-using-oauth2-0/ Here process is working fine but i don't getting any data from the service like username , email etc. no any data is returning for me...
13 Jan 2015 by Mohan Gopi
Hi Friends, I have created sample web api Token Based Authentication. In this i Want to authenticate using OWIN middleware and bearer tokens. However I already have a database and don't want to use Microsoft's new Identity framework as the majority of tables and columns that it auto...
13 Jan 2015 by Mohan Gopi
Hi Frieds, I have created simple web api Token Based Authentication using Oathu 2. In this is there any way to capture the generated Access token before it is sent in the response to the client? I want to store the token in local DataBase.Thanks in Advance,Mohan G
1 Feb 2015 by Mohan Gopi
Maybe can be useful to somebody, I found the answer here: You will get the Solution if you refer the the follwing links... http://stackoverflow.com/questions/26071743/how-do-you-get-the-oauth2-accesstoken-after-its-creation-from-the-owin-api[^]
23 Apr 2015 by Acision
In the following tutorial, find out how to create your first video chat application using the forge by Acision SDK in less than 10 minutes.
4 Aug 2015 by suchithm
Posted my solution here http://appliedcodelog.blogspot.in/2015/08/login-by-google-account-integration-for.html[^]
7 Aug 2015 by Roshan FIS
I would like to know how the OAuth login works in the Account controller of a default MVC5 application. My question can be related to social login in CodeProject too.Here is my understanding about the code flow:-The user can register directly to our website, or he may use the social...
15 Sep 2015 by Member 11737804
How to get a access token from google in .net and how to use that token in retrieving the blog details from blogger.It'll be better for me if someone can provide me the source code.You can mail me at ankur.chaudhary.aug1992@gmail.comThanks in Advance!!
24 Sep 2015 by KVPalem
I am trying to implement security in Azure API Management with OAuth 2.0 to Authorize the backend services. I am able to configure OAuth security with Azure Active Directory and Google Identity Provider.But @ a time i am able to configure only one Identity provider i.e. either Azure AD or...
20 Nov 2015 by atulonweb@gmail.com
Hi experts,I am very new to OAuth. I have to access REST ful webapi, which are secured by OAuth2.0.They have provided everything but I dont know how to do that.They asked to create applicationId and secret. I created those but I don't how to call those API and specially from...
11 Dec 2015 by Member 10714689
Hi,I have the requirement like to do sales force authentication from ASP.Net MVC5 web login form using SAML or OAuth protocolwork flow is like:1.stored user salesforce credentials in SQL db Login table.2.In Asp.net MVC Login page(User created): user will give his salesforce...
13 Dec 2015 by Member 10714689
Hi,How to implement Single sign on(SOS) in asp.net mvc 5 application using OAuth/SAML protocol.not by using Forms authentication.can anyone help me in this regard plz.Thanks in advance.
27 Dec 2015 by IntelligentDev
Is it possible to implement OAuth 2 Token based authentication with Organization Active Directory in Mvc Web API?
10 May 2016 by AssafStern
Hey everyone, I’m trying to write a simple web application using .Net which shows a user a simple web page with a single button. By clicking on the button the user authenticates his Gmail account using OAuth2 and then the page lists him with his unread emails.This is my...
6 Jul 2016 by emboi
I have already received an external token from linkedinNow I wanted to register the authenticated linkedIn account to the local app account.I am posting to the api/account/registerExternal passing along with the token that LinkedIn provided but I always get the message...
18 Sep 2016 by SmackDatCode
I've tried to implement JWT/OAuth With Identity 2.1 in single Application MVC 5 in better words OAuth server and the resource server are the same, Since i am new to the concept i am doing as this Tutorial has done so. At the moment I am stuck with Getting signingCredentials going.In Code...
5 Dec 2016 by gautam mishra75
When I read data from Google drive from my app first time , google asks to allow access in new popup window. How to open the content of the popup in same page instead of in new popup?Here is the Screeshot - [Click here]What I have tried:
15 Jan 2017 by Pritesh Gadhiya
Hello Sir/Madam, Any solution for OAuth 2.0 in wcf rest service?
23 Feb 2017 by Member 12929639
Hello,I need to send emails in java code using OAUTH2. I have got client Id and client secret from Google API Console[^] and trying to get authorization code at [^] from where I have found 3 tokens, Authorization code, Refresh token and Access token. When I replace Oauth token with...
23 Feb 2017 by Graeme_Grant
Have you tried Google's own Java Client Lib? I'll give you google java client api - Google Search[^] as it points to a number of key pages for you. Thier instructions and samples are very good.
23 Feb 2017 by Member 12929639
I will try it also, but the java codes I was trying earlier to send emails were facing issues after deployment. I am using Amazon services for hosting of my web application and often mail requests are blocked by hosting server. Therefore I am searching for more secure method to send emails...
11 Jan 2018 by Graeme_Grant
Grab the DropBox lib from here: .NET - Developers - Dropbox[^] Get your API key from here: Login - Dropbox[^] And here is how: .NET - Developers - Dropbox[^]
4 Jun 2018 by JoshBab
The solution to this is simple and I would highlight the procedure thus: 1.)Create an app from Dropbox App Console. Choose App Folder (this is a preferable option) or Full Dropbox for Access Type; enter a name for your app (e.g. myapp). Click "Create App" button. Another page is displayed,...
15 Feb 2019 by Vijai Anand.G
I am trying develop single login application where registered users can give their pin for Login . We have API to Validate and give access_token for pin users.We have to consider latest browser instance of pin user as valid one.If the pin user is trying to access Previous instance of browser, we...
15 Feb 2019 by Marbry Hardin
You could use something like SignalR where all your apps subscribed to LogOut() client notification method. Then, when any of them called a LogMeOut() server method, it could fire LogOut() to all subscribed clients.
15 Feb 2019 by Afzaal Ahmad Zeeshan
I think addition of SignalR will be unnecessary, since we can easily store the values and upon a request we can valid if they are valid or we need to block them. Also, SignalR requires that you add an extra layer of service, and if the connections are not cleared they might reuse the token...
19 Feb 2019 by lsavidge
I downloaded the console application example which uses OAuth 2 to connect to the code projects server and get the titles of the articles and questions. It works and does what it says on the tin. I've got to write an application that connections to the UK HMRC servers to send them information...
19 Feb 2019 by RickZeeland
See User-restricted endpoints - HMRC Developer Hub - GOV.UK[^] and Reference guide - HMRC Developer Hub - GOV.UK[^] Quote: The URI that we use to send users back to your application after successful (or unsuccessful) authorisation. This must match one of the redirect URIs you specified when...
19 Feb 2019 by lsavidge
I have read that documentation. Taking a step back, if we are talking web technologies, I make a request and the application I am using waits for a response. No different from using a web browser. Click a click, wait for a response. With HMRC, if I am submitting, I submit and await a response....
20 May 2020 by Grupo Microsistemas
I´m trying to send a email using Oauth2, but i´m getting a error when i authenticate my user. This is the error "An unhandled exception of type 'MailKit.Security.AuthenticationException' occurred in mscorlib.dll Additional information: 334:...
14 Oct 2020 by Member 12731696
Hi What I am doing : I am trying to use google sign in button so that I can get a tokenId and send it to the django rest api where it can verify with Google api and create a new user from the email retrieved (if the user is not registered by...
27 Jun 2021 by john Tucker 2021
I have been trying to add Google's Oauth2 to my ReactJs app but I get 2 errors which Are probably coming from a syntax error this is the part of the code where I get the errors import React from 'react' import { useGoogleLogin } from...
17 Dec 2021 by Member 12561559
Hi, Im trying to send a json string as part of content on the 2nd stage section of oauth2 to our client who is using salesforce along with the access_token. They have verified, as far as they can tell, that everything is working fine via...
17 Dec 2021 by Member 12561559
Figured it out. Dim content = New StringContent(BigString, Encoding.UTF8, "application/json") Dim method = New HttpMethod("PATCH") Dim request2 = New HttpRequestMessage(method, SendJsonStrURL) ...
15 Mar 2022 by Nikola Breznjak
Adding Google OAuth support to Raneto as the latter allows only basic username/password authentication
12 Jul 2022 by jomondoth
I have a console application which tried to connect to mailbox for processing the mails. program uses OAuth 2.0 for outlook authentication. Application will load user interactive window for the authentication using...
21 Sep 2022 by Fredeirk Van Lierde
There is a great NuGet Packages available + find code samples here Super Easy Way to Automate Posting on LinkedIn with .Net - CodeHelper[^] Quick explanation 1. You create your LinkedInHelper by giving your access token 2. Execute the...
26 Oct 2022 by Member 14653594
I'm trying to associate user with multiple social accounts in Django Rest Framework. After user login, user can associate with social accounts (it doesn't matter same email or different email). Now I am using the library [drf-social-oauth2] I...
6 Dec 2022 by Member 12561559
Hi, So Im getting positive results of Oauth authentication if I manually select an account to use within my browser, but since I do not want to select an account, I need my oauth to utilise the account that Im trying to get access to. Dim L as...
6 Dec 2022 by Member 12561559
So thanks to Richard, his code got me searching and I managed to find what I needed, to acquire the AuthToken, without using a browser, just replace the values with your own and pass the AuthToken string to your mail component to mail onwards...
13 Dec 2022 by Member 12561559
Hi code, is in vb.net, I can acquire a authtoken if I specify .default - but if I try to specify Mail.Send for example, I dont get an authtoken: (smtpoauth2_* are vars) Dim redirectUri = "http://localhost:3017" Dim scopes = New...
13 Dec 2022 by Richard Deeming
According to the documentation, the "scopes" for the client credentials flow must be: https://outlook.office365.com/.default But there are several steps you need to take to grant the necessary permissions to your application: Authenticate an...
15 Mar 2023 by Alessandro Magistroni
Oauth2 Client with IdentityModel.AspNetCore
3 Jun 2023 by Rafael Falagan
Hello: I'm trying to convert an existing integration to UPS web services to the new Web API using OAuth 2.0 security model. I would like to be able to pick up as much logic as possible from the current implementation using web services. Not...
2 Oct 2023 by Jithu_007
I am facing a CORS issue when trying to make OIDC login requests from my React frontend to my Express.js backend, which acts as a Backend for Frontend (BFF). The specific issue occurs when my backend generates the authentication URL (authURL) for...
18 May 2017 by Abhijit S Kulkarni
Token Based Authentication for Web API
16 Feb 2015 by Taiseer Joudeh
Part 3: Tutorial shows how to implement OAuth JSON Web Tokens Authentication (JWT) using ASP.NET Web API 2.2 and ASP.NET Identity 2.1
23 Feb 2017 by Livio Francescucci
An introductory description of the OAuth2 Authorization flows, explained using real world examples
7 May 2017 by Livio Francescucci
A guided walk-through to build a simple Authorization Server and enable a Client Credentials workflow using Identity Server and .NET Core
29 May 2017 by Veronica S. Zotali
This article shows how to configure IdentityServer3, when you need to authenticate and authorize usage of your WebAPI/MVC, for users stored in SQL Server.
5 Feb 2015 by Brian Alexakis
This top 5 list is to help equip you with the tools and knowledge needed to analyze how a vendor implements OAuth2.0, how to interface with RESTful APIs, and ultimately gain access to end user data.
14 Dec 2014 by Prashant Kurlekar
A simple Twitter client application targetting iOS and Android using Xamarin.Forms, Xamarin.Auth and the LinqToTwitter library
18 Jan 2023 by harili
Hello ! When I trying to make a call in the api using “https://login.uber.com/oauth/v2/token” an "error" error is returned: "invalid_scope". I provide the authentication correctly and the scope on the dashboard is correctly configured as well as...
17 Jul 2023 by MrJay994
I've created a C++ API in Ubuntu (following this tutorial https://levelup.gitconnected.com/building-an-api-in-c-with-pistache-413247535fd3) and I would like to secure it with OAuth 2 with POCO. ...
4 Jun 2018 by naveenjain25
Hi, I want to upload some text files from my C# .Net web application to dropbox account. I have created dropbox App but don't getting clear idea how accomplish that. Please help me to provide steps to upload files from C# .Net web application to dropbox account. Thanks! Naveen ...
20 Feb 2017 by Abhinaw Kumar Singh
I am new to MVC 5 authentication. Currently I tried Google Authorization using OwinThe code in startup.Auth.csvar googleOAuth2AuthenticationOptions = new GoogleOAuth2AuthenticationOptions{ ClientId = "Client-id", ClientSecret = "secret-key", CallbackPath = new...
2 Sep 2014 by Swati Agarwal
Hi , Could anyone pls tell if any libraries other than hello.js are available for Oauth which are free to use for commercial use(Do not have copy right issues)
3 May 2015 by funtoblog369
I need in javaHow do i receive OAuth access code and use it for download & upload of documents in google drive?
26 May 2015 by Varun Sriram
Code School has very good tutorial for this. You can use below link to access that coursehttp://campus.codeschool.com/courses/discover-drive/contents[^]
20 Feb 2017 by Amit R Jaiswal
Try adding following tag in webconfig AppSetting,
21 Sep 2022 by prakash00060
I have to post image to the linkedin from my asp.net mvc applicaiton. What I have tried: Quote: function ShareLinkedIn() { var Array = $('#VacancyGrid [name=id]:checked').map(function() { return $(this).val(); ...
8 Oct 2023 by Jithu_007
"What could be the reason for encountering a 'Socket Hang Up' error when dealing with OAuth 2.0 Redirect URL Issue in a React App and Node.js Backend, despite successfully receiving a response in Postman, especially when using Node.js POST...
7 Oct 2023 by Jithu_007
I am currently working on implementing OAuth 2.0 in my React application for user authorization. To achieve this, I have set up a custom Auth Provider with all the necessary configurations, such as the client ID and client secret. Here's the...