Giter Site home page Giter Site logo

philipp-meier / openidconnectrazor Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 863 KB

:wrench: Demonstrates how Keycloak (v18.0.0) OpenID Connect authentication can be used with ASP.NET Core Razor Pages.

License: MIT License

HTML 40.53% C# 47.39% CSS 9.95% JavaScript 2.14%
asp-net-core csharp example keycloak oidc openid-connect razor razor-pages

openidconnectrazor's Introduction

OpenIdConnectRazor

Demonstrates how Keycloak (v18.0.0) OpenID Connect authentication can be used with ASP.NET Core Razor Pages.

Summary

This is an alternative to using ASP.NET Core Identity. Keycloak is used as an Identity Provider (IdP), so the application does not have to manage its own identities and only consumes the OIDC information.

To achieve this, two authentication schemes are used:

  • OpenID Connect: Used to challenge the authentication. Users will be redirected to the OIDC provider, so they can log in and return with an identity.
  • Cookie: To persist the identity of the user by using the OIDC information.

When logging out, the cookie will be removed and a logout request to the IdP will be made.

Usage

By clicking on the Privacy-menu, the user will be redirected to the Keycloak login page.
The user will be redirected to the Privacy page again, once he is authenticated and the Logout menu appears.

Keycloak settings

Ensure that your Keycloak client uses the openid-connect protocol and the access type is set to confidential.
To test this locally, your configured root URL should be https://localhost:7298/ and the "valid redirect URIs" should be the following:

openidconnectrazor's People

Contributors

philipp-meier avatar

Watchers

 avatar

Forkers

bhengu-dev

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.