Skip to content

Commit 656763e

Browse files
authored
Merge pull request #8 from dark-loop/security
adding check on auth scheme
2 parents 4e90fb6 + 4de5d5a commit 656763e

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.build/release.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<Authors>Arturo Martinez</Authors>
55
<Company>DarkLoop</Company>
66
<PackageId>DarkLoop.Azure.Functions.Authorize</PackageId>
7-
<IsPreview>true</IsPreview>
7+
<IsPreview>false</IsPreview>
88
<AssemblyVersion>3.0.0.0</AssemblyVersion>
99
<Version>3.1.0</Version>
1010
<FileVersion>$(Version).0</FileVersion>

src/DarkLoop.Azure.Functions.Authorize/Security/FunctionsAuthenticationBuilder.cs

+6-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,12 @@ public FunctionsAuthenticationBuilder AddJwtBearer(Action<JwtBearerOptions> conf
4242
if(removeBuiltInConfig)
4343
{
4444
var descriptor = Services.FirstOrDefault(s => s.ServiceType == typeof(IConfigureOptions<JwtBearerOptions>));
45-
Services.Remove(descriptor);
45+
var instance = descriptor?.ImplementationInstance as ConfigureNamedOptions<JwtBearerOptions>;
46+
47+
if (instance?.Name == "Bearer")
48+
{
49+
Services.Remove(descriptor);
50+
}
4651
}
4752

4853
this.Services

0 commit comments

Comments
 (0)