Comments (5)
That may not be a bad idea. Originally, the default configuration is just there to get started quickly, but usually you'll want to handle authentication yourself, in which case you may not want to use the default setup other than perhaps as an example. However, that also means you'd need to handle setting up the claims identity such that it has the permissions claim. If we just offer a default setup using a different scheme, then perhaps it can work side by side with an application specific scheme (which probably is called Bearer as you mentioned)
from elsa-core.
The exception you're encountering indicates that there is an attempt to add an authentication scheme with the name "Bearer" more than once. This can happen if AddAuthentication
is called multiple times with the same scheme or if different parts of the code are trying to configure the same authentication scheme independently.
To resolve this issue, you should ensure that the "Bearer" scheme is only added once throughout your application's startup configuration. Here are some steps you can take:
- Search your codebase for all occurrences of
AddAuthentication
andAddJwtBearer
to see if the "Bearer" scheme is being added more than once. - If you are using external libraries or packages that add authentication schemes, make sure they are not conflicting with your own authentication configuration.
- Check the order of operations in your startup configuration. Sometimes the order in which services are added can cause issues.
- If you have multiple projects or modules that are being integrated, ensure that they are not each trying to add the same authentication scheme.
Without seeing the actual code, it's difficult to provide a precise solution. However, the general approach is to review and consolidate your authentication configuration to prevent duplicate scheme registrations.
If you continue to have trouble, please provide more details about your startup configuration, especially around the authentication and authorization setup, so that a more specific solution can be provided.
This comment was generated by Glime.
from elsa-core.
From what I'm reading, perhaps elsa
should chose a more specific name for it's authentication schema? 🤔
Most applications are, by default, going to be using JwtBearerDefaults.AuthenticationScheme
since that's what is automatically configured for them if they have setup JWT auth. Which means the canonical JWT auth setup is in conflict with elsa
.
This call can specify the schema name:
from elsa-core.
That's a good point actually 🤔 , I have not yet integrated my auth scheme into Elsa. Actually, I have no idea how even!
I agree that most will move away from the default, but to ease the onboarding pain the default may want to be named something different to avoid the conflcit!
from elsa-core.
If elsa is not explicitly specifying the Authorization scheme to use, then I don't think it will work at all if an existing default one exists. Regardless of it one was to integrate their own identity or not no?
The IdentityFeature
also appears tosupply defaults for some of these services, how can this be changed?
.AddScoped<ISecretHasher, DefaultSecretHasher>()
.AddScoped<IAccessTokenIssuer, DefaultAccessTokenIssuer>()
.AddScoped<IUserCredentialsValidator, DefaultUserCredentialsValidator>()
.AddScoped<IApplicationCredentialsValidator, DefaultApplicationCredentialsValidator>()
.AddScoped<IApiKeyGenerator>(sp => sp.GetRequiredService<DefaultApiKeyGeneratorAndParser>())
.AddScoped<IApiKeyParser>(sp => sp.GetRequiredService<DefaultApiKeyGeneratorAndParser>())
.AddScoped<IClientIdGenerator, DefaultClientIdGenerator>()
.AddScoped<ISecretGenerator, DefaultSecretGenerator>()
.AddScoped<IRandomStringGenerator, DefaultRandomStringGenerator>()
.AddScoped<DefaultApiKeyGeneratorAndParser>()
from elsa-core.
Related Issues (20)
- [BUG] ParallelForEach Behavior Inconsistency HOT 2
- [BUG] C# scripting memory leak HOT 1
- [BUG] Elsa.UseMongoDb() options.DatabaseName does not set Database HOT 1
- [BUG] The call is ambiguous between the following methods or properties: Microsoft.AspNetCore.Mvc.Versioning with .net8 HOT 1
- [BUG] Returning Null from Elsa Mediator handler SendAsync throws InvalidCastException HOT 1
- [BUG] Error running project HOT 1
- [BUG] IFormFile in c# scripting HOT 1
- [BUG]How does Elsa use Sqlserver? HOT 2
- [BUG] odd behavior with WF API with debugging and non debuging HOT 1
- [BUG]Elsa 3.0 is not Elsa.Persistence.EntityFramework.SqlServer? HOT 1
- [BUG]Elsa.EntityFrameworkCore.SqlServer启动如何配置? HOT 1
- [BUG]Elsa 3.0 如何配置为使用 SQL Server 数据库? HOT 1
- [BUG]Elsa 3.0 NuGet包,没有Elsa的SQL Server持久性提供程序? HOT 1
- [BUG]Elsa.EntityFrameworkCore.SqlServer在program如何配置? HOT 1
- [BUG] StatusCode cannot be set because the response has already started. HOT 1
- [BUG] BookmarksDeleted notification not send on index (Elsa 2.14.1) HOT 1
- [BUG] Infinite Looping in Event Activity in v3 HOT 3
- PopulateRegistriesHostedService - Failed to ensure that lock file directory /usr/app/App_Data/locks exists HOT 3
- [BUG] variables are not available in the JS expression engine context. Only accessors are available. HOT 1
- http activity(flow) multiple input port error [BUG] [V3] HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elsa-core.