Skip to content

Commit 09d612e

Browse files
Fix "Method not found:Boolean Okta.AspNet.Abstractions.OktaParams.IsromptEnrollAuthenticator" issue (#231)
* Fix "Method not found:Boolean Okta.AspNet.Abstractions.OktaParams.IsPromptEnrollAuthenticator" issue (#228) * Update assemblies' version. * Update docs to show how to add custom claims in tokens (#232) Update docs to show how to add custom claims in tokens.
1 parent 25b59d1 commit 09d612e

File tree

8 files changed

+92
-13
lines changed

8 files changed

+92
-13
lines changed

Okta.AspNet.Abstractions/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Changelog
22
Running changelog of releases since `3.0.5`
33

4+
## v4.2.1
5+
6+
### Bug Fixes
7+
8+
- Fix "Method not found:Boolean Okta.AspNet.Abstractions.OktaParams.IsPromptEnrollAuthenticator" issue (#228)
9+
410
## v4.2.0
511

612
### Features

Okta.AspNet.Abstractions/Okta.AspNet.Abstractions.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFrameworks>net452;netstandard2.0</TargetFrameworks>
5-
<Version>4.2.0</Version>
5+
<Version>4.2.1</Version>
66
</PropertyGroup>
77

88
<PropertyGroup>
@@ -36,8 +36,8 @@
3636
<SignAssembly>true</SignAssembly>
3737
<AssemblyOriginatorKeyFile>okta.aspnet.public.snk</AssemblyOriginatorKeyFile>
3838
<DelaySign>true</DelaySign>
39-
<AssemblyVersion>3.2.2.0</AssemblyVersion>
40-
<FileVersion>3.2.2.0</FileVersion>
39+
<AssemblyVersion>4.2.1.0</AssemblyVersion>
40+
<FileVersion>4.2.1.0</FileVersion>
4141
</PropertyGroup>
4242

4343
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

Okta.AspNet/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Changelog
22
Running changelog of releases since `1.6.0`
33

4+
## 3.2.2
5+
6+
### Bug Fixes
7+
8+
- Fix "Method not found:Boolean Okta.AspNet.Abstractions.OktaParams.IsPromptEnrollAuthenticator" issue (#228)
9+
410
## 3.2.1
511

612
### Features

Okta.AspNet/Okta.AspNet.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<Description>Official Okta middleware for ASP.NET 4.6.2+. Easily add authentication and authorization to ASP.NET applications.</Description>
55
<Copyright>(c) 2019 Okta, Inc.</Copyright>
6-
<Version>3.2.1</Version>
6+
<Version>3.2.2</Version>
77
<Authors>Okta, Inc.</Authors>
88
<TargetFramework>net462</TargetFramework>
99
<AssemblyName>Okta.AspNet</AssemblyName>
@@ -30,8 +30,8 @@
3030

3131
<PropertyGroup>
3232
<CodeAnalysisRuleSet>..\OktaSdk.ruleset</CodeAnalysisRuleSet>
33-
<AssemblyVersion>3.0.2.1</AssemblyVersion>
34-
<FileVersion>3.0.2.1</FileVersion>
33+
<AssemblyVersion>3.0.2.2</AssemblyVersion>
34+
<FileVersion>3.0.2.2</FileVersion>
3535
<SignAssembly>true</SignAssembly>
3636
<AssemblyOriginatorKeyFile>okta.aspnet.public.snk</AssemblyOriginatorKeyFile>
3737
<DelaySign>true</DelaySign>

Okta.AspNetCore/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Changelog
22
Running changelog of releases since `3.2.0`
33

4+
## v4.4.2
5+
6+
### Bug Fixes
7+
8+
- Fix "Method not found:Boolean Okta.AspNet.Abstractions.OktaParams.IsPromptEnrollAuthenticator" issue (#228)
9+
410
## v4.4.1
511

612
### Features

Okta.AspNetCore/Okta.AspNetCore.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
<PropertyGroup>
88
<Description>Official Okta middleware for ASP.NET Core 3.1+. Easily add authentication and authorization to ASP.NET Core applications.</Description>
99
<Copyright>(c) 2020 - present Okta, Inc. All rights reserved.</Copyright>
10-
<Version>4.4.1</Version>
11-
<VersionPrefix>4.4.1</VersionPrefix>
10+
<Version>4.4.2</Version>
11+
<VersionPrefix>4.4.2</VersionPrefix>
1212
<Authors>Okta, Inc.</Authors>
1313
<AssemblyName>Okta.AspNetCore</AssemblyName>
1414
<PackageId>Okta.AspNetCore</PackageId>

docs/aspnet4x-mvc.md

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,13 +267,41 @@ public class HomeController : Controller
267267

268268
This example assumes you have a view called `Claim` whose model is of type `System.Security.Claims.Claim`. The claim types for OIDC tokens are `id_token` and `access_token` as well as `refresh_token` if available.
269269

270-
## Handling failures
270+
## Hooking into OIDC events
271271

272-
This library exposes [OpenIdConnectEvents](https://docs.microsoft.com/en-us/previous-versions/aspnet/mt180963(v=vs.113)) so you can hook into specific events during the authentication process. For more information see [`AuthenticationFailed`](https://docs.microsoft.com/en-us/previous-versions/aspnet/mt180967(v=vs.113)).
272+
This library exposes [OpenIdConnectEvents](https://docs.microsoft.com/en-us/previous-versions/aspnet/mt180963(v=vs.113)) so you can hook into specific events during the authentication process.
273273
274+
### Adding custom claims
274275

275-
The following is an example of how to use events to handle failures:
276+
The following is an example of how to use events to add custom claims to the token:
276277

278+
```csharp
279+
public class Startup
280+
{
281+
public void Configuration(IAppBuilder app)
282+
{
283+
app.UseOktaMvc(new OktaMvcOptions()
284+
{
285+
// ... other configuration options removed for brevity ...
286+
OpenIdConnectEvents = new OpenIdConnectAuthenticationNotifications
287+
{
288+
SecurityTokenValidated = (notification) =>
289+
{
290+
notification.AuthenticationTicket.Identity.AddClaim(new Claim("CodeCustomClaimKey", "CodeCustomClaimValue"));
291+
292+
return Task.CompletedTask;
293+
}
294+
},
295+
});
296+
}
297+
}
298+
```
299+
300+
> Note: For more information see [`SecurityTokenValidated`](https://learn.microsoft.com/en-us/previous-versions/aspnet/mt180993(v=vs.113))
301+
302+
### Handling failures
303+
304+
The following is an example of how to use events to handle failures:
277305

278306
```csharp
279307
public class Startup
@@ -300,6 +328,7 @@ public class Startup
300328
}
301329
}
302330
```
331+
> Note: For more information see [`AuthenticationFailed`](https://docs.microsoft.com/en-us/previous-versions/aspnet/mt180967(v=vs.113))
303332
304333
# Configuration Reference
305334

docs/aspnetcore-mvc.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,10 +357,39 @@ public class HomeController : Controller
357357

358358
This example assumes you have a view called `OIDCToken` whose model is of type `TokenModel`. The OIDC tokens are `id_token` and `access_token` as well as `refresh_token` if available.
359359

360-
## Handling failures
360+
## Hooking into OIDC events
361361

362-
In the event a failure occurs, the Okta.AspNetCore library exposes [OpenIdConnectEvents](https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.authentication.openidconnect.openidconnectevents.onauthenticationfailed) so you can hook into specific events during the authentication process. For more information See [`OnAuthenticationFailed`](https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.authentication.openidconnect.openidconnectevents.onauthenticationfailed) or [`OnRemoteFailure`](https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.authentication.remoteauthenticationevents.onremotefailure).
362+
In the event a failure occurs, the Okta.AspNetCore library exposes [OpenIdConnectEvents](https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.authentication.openidconnect.openidconnectevents.onauthenticationfailed) so you can hook into specific events during the authentication process.
363363
364+
### Customizing claims
365+
366+
The following is an example of how to use events to add custom claims to the token:
367+
368+
```csharp
369+
public class Startup
370+
{
371+
public void ConfigureServices(IServiceCollection services)
372+
{
373+
services.AddOktaMvc(new OktaMvcOptions
374+
{
375+
// ... other configuration options removed for brevity ...
376+
OpenIdConnectEvents = new OpenIdConnectEvents
377+
{
378+
OnTokenValidated = context =>
379+
{
380+
ClaimsIdentity claimsIdentity = context.Principal.Identity as ClaimsIdentity;
381+
claimsIdentity.AddClaim(new Claim("MyCustomClaimKey", "MyCustomClaimValue"));
382+
383+
return Task.CompletedTask;
384+
}
385+
},
386+
});
387+
}
388+
```
389+
390+
> Note: For more information See [`OnTokenValidated`](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.authentication.openidconnect.openidconnectevents.ontokenvalidated).
391+
392+
### Handling failures
364393

365394
The following is an example of how to use events to handle failures:
366395

@@ -399,6 +428,9 @@ public class Startup
399428
}
400429
}
401430
```
431+
432+
> Note: For more information See [`OnAuthenticationFailed`](https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.authentication.openidconnect.openidconnectevents.onauthenticationfailed) or [`OnRemoteFailure`](https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.authentication.remoteauthenticationevents.onremotefailure).
433+
402434
# Configuration Reference
403435

404436
The `OktaMvcOptions` class configures the Okta middleware. You can see all the available options in the table below:

0 commit comments

Comments
 (0)