Connect an ASP.NET and ASP.NET MVC web site using OAuth 2.0
With a few steps you can connect your ASP.NET or ASP.NET MVC web site to The Identity Hub using OAuth 2.0.
A. Create an App
- Create an App for your application. See Create an App for details.
- For Redirect URI's set the URI of your website including the port number if it is different than the default 443.
B. Install the SDK
- In Visual Studio open the ASP.NET or ASP.NET MVC solution.
- Right-click the web project and click Manage NuGet packages.
- On the Browse tab search for TheIdentityHub.AspNet
- Select TheIdentityHub.AspNet from the list and click Install.
C. Download and apply the web.config
- Navigate to the Apps list (https://www.theidentityhub.com/{tenant}/Admin/App) and select the application you are connecting.
- Open the Web Application OAuth 2.0 section (you might need to scroll down to find the section).
- Under Example configuration for .NET click web.config.
- Copy the content of the example web.config in the web.config file of the web application project. If you already have configuration in the web.config copy the system.webServer > modules section and the appSettings.
- Run your web application.
See the ASP.NET SDK for more configuration options and on how to get information on the authenticated user.
D. OAuth 2.0 parameters to connect when connecting without the SDK
- Navigate to the Apps list (https://www.theidentityhub.com/{tenant}/Admin/App) and select the application you are connecting.
- Open the Web Application OAuth 2.0 section (you might need to scroll down to find the section) to see the OAuth 2.0 parameters like client_id, client_secret…