OAuth2 GitLab authentication provider for ASP.NET Core
In order to make this available to a wider range of people, I decided to push this to the AspNet.Security.OAuth.Providers repository instead of publishing the nuget package on my own.
Head over to AspNet.Security.OAuth.Providers and use the appropriate nuget package.
Make sure, to update the ClientId and ClientSecret, eigher in the appsettings.json
:
"Authentication": {
"GitLab": {
"ClientId": "...",
"ClientSecret": "..."
}
}
or directly within the code:
services.AddAuthentication().AddGitLab(options =>
{
// Provide the GitLab Client ID
options.ClientId = "...";
// Provide the GitLab Secret
options.ClientSecret = "...";
});