Giter Club home page Giter Club logo

aspnetcoreopeniddict's Introduction

.NET

Implementing OpenID Code Flow PKCE using OpenIddict, Angular and Blazor

  • Angular Code flow PKCE public client
  • Blazor WASM, ASP.NET Core hosted BFF Code flow PKCE, trusted client
  • API OAUTH2 introspection and reference tokens
  • OpenID Connect server implemented with OpenIddict

Blogs:

Implementing OpenID Code Flow with PKCE using OpenIddict and Angular

Secure a Blazor WASM ASP.NET Core hosted APP using BFF and OpenIddict

Using Blazor with a YARP downstream API protected using certificate authentication

Implement an OpenIddict identity provider using ASP.NET Core Identity with Keycloak federation

Add Fido2 MFA to an OpenIddict identity provider using ASP.NET Core Identity

Implement a GRPC API with OpenIddict and the OAuth client credentials flow

Creating Migrations

Console

dotnet ef migrations add initSts -c ApplicationDbContext

Powershell

Add-Migration "init_sts" -c ApplicationDbContext

Running manually

Update-Database -Context ApplicationDbContext

History

  • 2024-04-14 Updated packages
  • 2024-01-14 Updated packages, fixed CSP
  • 2024-01-04 Updated packages
  • 2023-11-26 Updated .NET 8
  • 2023-11-03 Updated packages, fix security headers
  • 2023-09-22 Updated packages
  • 2023-07-08 Updated packages
  • 2023-04-28 Updated packages
  • 2023-01-10 Updated packages
  • 2022-12-24 Updated .NET 7, OpenIddict v4
  • 2022-09-02 Updated packages, added client credentials flows
  • 2022-08-20 Updated packages
  • 2022-07-01 Add support for FIDO2 to the OpenIddict server
  • 2022-06-19 Update packages
  • 2022-06-04 Update packages
  • 2022-05-20 Update packages
  • 2022-05-02 Update packages, add external provider
  • 2022-03-20 Update , using nullable
  • 2022-02-07 Update solution
  • 2022-01-23 Fix API calls
  • 2022-01-21 Update project
  • 2022-01-04 Update STS
  • 2022-01-01 Added Blazor BFF WASM ASP.NET Core hosted demo
  • 2021-12-24 Updating .NET 6, Angular 13.1.0
  • 2021-07-01 Updating .NET 5, Angular 12
  • 2021-04-21 Updated packages, improved scope validation
  • 2020-12-26 Updating to .NET 5, Angular 11
  • 2018-05-27 Updating to .NET Core 2.1
  • 2018-02-09 Updating npm and Angular 5.2.4
  • 2018-02-03 Updating npm and nuget packages, Angular 5.2.3, angular-auth-oidc-client 4.0.1
  • 2017-11-24 Updated ASP.NET Core 2, Angular 5.0.3, angular-auth-oidc-client
  • 2017-06-13 Updated using angular-auth-oidc-client 0.0.4 and Angular to 4.2.2
  • 2017.06.09 Updated Auth Module, and angular to 4.1.3

Links:

https://documentation.openiddict.com/

https://github.com/damienbod/Blazor.BFF.OpenIDConnect.Template

https://github.com/openiddict/openiddict-core

https://github.com/robinvanderknaap/authorization-server-openiddict

http://kevinchalet.com/2016/07/13/creating-your-own-openid-connect-server-with-asos-implementing-the-authorization-code-and-implicit-flows/

openiddict/openiddict-core#49

https://github.com/openiddict/openiddict-samples

https://blogs.msdn.microsoft.com/webdev/2017/01/23/asp-net-core-authentication-with-identityserver4/

https://blogs.msdn.microsoft.com/webdev/2016/10/27/bearer-token-authentication-in-asp-net-core/

https://blogs.msdn.microsoft.com/webdev/2017/04/06/jwt-validation-and-authorization-in-asp-net-core/

https://jwt.io/

https://www.scottbrady91.com/OpenID-Connect/OpenID-Connect-Flows

https://damienbod.com/2022/01/10/comparing-the-backend-for-frontend-bff-security-architecture-with-an-spa-ui-using-a-public-api/

Keycloak links

https://docs.microsoft.com/en-us/java/openjdk/download

https://github.com/tuxiem/AspNetCore-keycloak

https://wjw465150.gitbooks.io/keycloak-documentation/content/server_installation/topics/network/https.html

aspnetcoreopeniddict's People

Contributors

damienbod avatar dependabot[bot] avatar smargoli2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aspnetcoreopeniddict's Issues

CORS issue in Angular client

Hi Damien - thanks for this project.
I'm trying to get it working in Angular - I have the OpeniddictServer running and responding correctly but I get a CORS error in the Angular client. Do I need to setup CORS in the OpeniddictServer?

image

OpenIDConnectSettings problem

When starting the application I get this error:

An unhandled exception occurred while processing the request.
JsonReaderException: Unexpected character encountered while parsing value: <. Path '', line 0, position 0.
Microsoft.IdentityModel.Json.JsonTextReader.ParseValue ()

InvalidOperationException: IDX20803: Unable to obtain configuration from: 'System.String'.
Microsoft.IdentityModel.Protocols.ConfigurationManager .GetConfigurationAsync (CancellationToken cancel)

This is the appsetting.json file

"OpenIDConnectSettings": { "Authority": "https://localhost:44348", "ClientId": "blazorcodeflowpkceclient", "ClientSecret": "3B104FC1-E63C-4DA4-858F-C572A68DB041" }

Guidance

Is it possible to call from the Blazor Client (through HttpClient) to the Resource Server if you are authenticated with the cookie?
I tried but it refuses to authenticate. If i remove the Authorize in the resource server it works as expected, and the aspnet cookie is in the headers.

Custom parametes.

Hello,
Is there any possibility to pass custom parameters (known for the login call for instance, but not known in time of configuration created) to token and refresh token requests?

void callback hell

I think you can void callback hell with using rxjs or promise, co library in AuthorizedCallback method

Error in HTML [(ngModel)]="DataEventRecord.name" null after dataeventrecords-create

Hi Damien,
First, Thank you! This is a fantastic repo! You and Kevin Chalet have done some really amazing work.

I get an error in the console of the AngularCliCodeFlowPkce project after creating a new dataevent record in the dataeventrecords-create.component.html: Cannot read properties of null (reading 'name')

The call to the dataEventRecordsService.Add() in the component does not return a value, so on line 45 the .subscribe((data: any) => this.DataEventRecord = data, will set this.DataEventRecord to null, and if the model updates before it can navigate it will throw the error and prevent this._router.navigate() from doing it's thing.

So, just commenting out line 45 takes care of it. But also, since Rxjs Subscription is deprecated, It might be better to use the .subscribe({ next: (), error: (), complete: ()}); pattern something like this:

 
           this._dataEventRecordsService.Add(this.DataEventRecord).subscribe({ 
                next: (data: any) => {
                    console.log("Data", data);
                   //this.DataEventRecord = data;
                },
               error: err => {console.log("ERROR contacting api", err);},
               complete: () => {
                   console.log("Successfully added DataEventRecord");
                   this._router.navigate(['/dataeventrecords']);
                }
            });


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.