GithubHelp home page GithubHelp logo

dotnetcoreoauth2's Introduction

DotNetCoreOauth2

Library to help implementing OAuth2 authentication in .NET Core

WebAppTest

You can find a video that explain better how the example works here.

This application is created to help use the library and to test various scenarios for OAUTH2, like accessing an IMAP Office 365 folder using XOAUTH2.

To use the application you need to configure the OAuth2 section in appsettings.json file specifying Authority client id and secret, or you can put the very same information in a file called DotNetCoreOauth2.json that is located in one of the parent folder of the project. This technique allow you to avoid including sensitive information in the source code of the project.

Office 365 IMAP scenario

Create the application in Azure, then navigate to https://{urlofapplication}/Oauth2/trigger-login and the app will generate the URL to trigger a code flow to get the access token. You can put a breakpoint in the GetToken method if you want to debug how the server ask for a real token from the code received in querystring.

The application is really simple, it stores in memory the latest token received, and if you want to check if that token can be used to access your IMAP folder, you can navigate to https://{urlofapplication}/Oauth2/office-365-get-mail?emailAddress=your-email-address. If you do not get an error MimeKit was able to autenticate, and you can use the token received to try to authenticate directly with the IMAP server with openssl.

dotnetcoreoauth2's People

Contributors

alkampfergit avatar

Watchers

puckie avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.