https://github.com/Authfix/Blazor-Oidc
Blazor implementation of the javascript Oidc-client library
https://github.com/Authfix/Blazor-Oidc
blazor blazor-extensions oidc-client web-assembly
Last synced: about 1 month ago
JSON representation
Blazor implementation of the javascript Oidc-client library
- Host: GitHub
- URL: https://github.com/Authfix/Blazor-Oidc
- Owner: Authfix
- License: mit
- Created: 2018-07-24T14:22:24.000Z (over 6 years ago)
- Default Branch: develop
- Last Pushed: 2018-07-26T07:32:07.000Z (over 6 years ago)
- Last Synced: 2024-12-07T19:51:15.487Z (4 months ago)
- Topics: blazor, blazor-extensions, oidc-client, web-assembly
- Language: C#
- Size: 647 KB
- Stars: 15
- Watchers: 5
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Oidc Blazor Extensions Oidc
This package adds a [Oidc-client](https://github.com/IdentityModel/oidc-client-js) library for [Microsoft ASP.NET Blazor](https://github.com/aspnet/Blazor).
The package aims to add the possibility to use oidc-client javascript library inside a Blazor project by using Blazor's interop capabilities.
# Features
This package *does not* implements all public features of the oidc-client library.
> Note: Only basic authentication is available for now.
# Sample usage
The following snippet shows how to setup the oidc client and allow authentication.
On the page where we want to begin the authentication process
```c#
var config = new IdentityConfiguration
{
Authority = "http://localhost:50000",
ClientId = "js",
PostLogoutRedirectUri = "http://localhost:50001/index.html",
RedirectUri = "http://localhost:50001/callback",
ResponseType = "id_token token",
Scope = "openid profile api1"
};var manager = new UserManager(config);
var user = await manager.GetUser();if(user == null)
{
await manager.SignIn();
}
else
{
// do anything
}
```And on the callback page
```c#
var manager = new UserManager(config);
await manager.SignInRedirectCallback();
```# Contributions and feedback
Please feel free to use the component, open issues, fix bugs or provide feedback.
# Contributors
The following people are the maintainers of the project:
- [Thomas Bailly](https://github.com/authfix)