-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
424 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
src/Auth0.AuthenticationApi/Models/Ciba/ClientInitiatedBackchannelAuthorizationRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
using System.Collections.Generic; | ||
using Microsoft.IdentityModel.Tokens; | ||
|
||
namespace Auth0.AuthenticationApi.Models.Ciba | ||
{ | ||
/// <summary> | ||
/// Contains information required for initiating a CIBA authorization request. | ||
/// </summary> | ||
public class ClientInitiatedBackchannelAuthorizationRequest : IClientAuthentication | ||
{ | ||
/// <inheritdoc cref="IClientAuthentication.ClientId"/> | ||
public string ClientId { get; set; } | ||
|
||
/// <inheritdoc cref="IClientAuthentication.ClientSecret"/> | ||
public string ClientSecret { get; set; } | ||
|
||
/// <inheritdoc cref="IClientAuthentication.ClientAssertionSecurityKey"/> | ||
public SecurityKey ClientAssertionSecurityKey { get; set; } | ||
|
||
/// <inheritdoc cref="IClientAuthentication.ClientAssertionSecurityKeyAlgorithm"/> | ||
public string ClientAssertionSecurityKeyAlgorithm { get; set; } | ||
|
||
/// <summary> | ||
/// A human-readable string intended to be displayed on both the device calling /bc-authorize and | ||
/// the user’s authentication device (e.g. phone) to ensure the user is approving the correct request. | ||
/// For example: “ABC-123-XYZ”. | ||
/// </summary> | ||
public string BindingMessage { get; set; } | ||
|
||
/// <inheritdoc cref="Ciba.LoginHint"/> | ||
public LoginHint LoginHint { get; set; } | ||
|
||
/// <summary> | ||
/// A space-separated list of OIDC and custom API scopes. | ||
/// </summary> | ||
public string Scope { get; set; } | ||
|
||
/// <summary> | ||
/// If you require an access token for an API, pass the unique identifier of the target API you want to access here | ||
/// </summary> | ||
public string Audience { get; set; } | ||
|
||
/// <summary> | ||
/// Used to configure a custom expiry time for this request. | ||
/// </summary> | ||
public int? RequestExpiry { get; set; } | ||
|
||
/// <summary> | ||
/// Any additional properties to use. | ||
/// </summary> | ||
public IDictionary<string, string> AdditionalProperties { get; set; } = new Dictionary<string, string>(); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/Auth0.AuthenticationApi/Models/Ciba/ClientInitiatedBackchannelAuthorizationResponse.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace Auth0.AuthenticationApi.Models.Ciba | ||
{ | ||
/// <summary> | ||
/// Contains information about the client initiated backchannel authorization (CIBA) response. | ||
/// </summary> | ||
public class ClientInitiatedBackchannelAuthorizationResponse | ||
{ | ||
/// <summary> | ||
/// Unique id of the authorization request. Can be used further to poll for /oauth/token. | ||
/// </summary> | ||
[JsonProperty("auth_req_id")] | ||
public string AuthRequestId { get; set; } | ||
|
||
/// <summary> | ||
/// Tells you how many seconds we have until the authentication request expires. | ||
/// </summary> | ||
[JsonProperty("expires_in")] | ||
public int ExpiresIn { get; set; } | ||
|
||
/// <summary> | ||
/// Tells how many seconds you must leave between poll requests. | ||
/// </summary> | ||
[JsonProperty("interval")] | ||
public int Interval { get; set; } | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
...uth0.AuthenticationApi/Models/Ciba/ClientInitiatedBackchannelAuthorizationTokenRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System.Collections.Generic; | ||
using Microsoft.IdentityModel.Tokens; | ||
|
||
namespace Auth0.AuthenticationApi.Models.Ciba | ||
{ | ||
/// <summary> | ||
/// Contains information required for request token using CIBA. | ||
/// </summary> | ||
public class ClientInitiatedBackchannelAuthorizationTokenRequest : IClientAuthentication | ||
{ | ||
/// <inheritdoc cref="IClientAuthentication.ClientId"/> | ||
public string ClientId { get; set; } | ||
|
||
/// <inheritdoc cref="IClientAuthentication.ClientSecret"/> | ||
public string ClientSecret { get; set; } | ||
|
||
/// <inheritdoc cref="IClientAuthentication.ClientAssertionSecurityKey"/> | ||
public SecurityKey ClientAssertionSecurityKey { get; set; } | ||
|
||
/// <inheritdoc cref="IClientAuthentication.ClientAssertionSecurityKeyAlgorithm"/> | ||
public string ClientAssertionSecurityKeyAlgorithm { get; set; } | ||
|
||
/// <summary> | ||
/// Unique identifier of the authorization request. This value will be returned from the call to /bc-authorize. | ||
/// </summary> | ||
public string AuthRequestId { get; set; } | ||
|
||
/// <summary> | ||
/// Any additional properties to use. | ||
/// </summary> | ||
public IDictionary<string, string> AdditionalProperties { get; set; } = new Dictionary<string, string>(); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...th0.AuthenticationApi/Models/Ciba/ClientInitiatedBackchannelAuthorizationTokenResponse.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace Auth0.AuthenticationApi.Models.Ciba | ||
{ | ||
public class ClientInitiatedBackchannelAuthorizationTokenResponse : AccessTokenResponse | ||
{ | ||
[JsonProperty("scope")] | ||
public string Scope { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace Auth0.AuthenticationApi.Models.Ciba | ||
{ | ||
/// <summary> | ||
/// Contains information about the user to contact for authentication. | ||
/// </summary> | ||
public class LoginHint | ||
{ | ||
[JsonProperty("format")] | ||
public string Format { get; set; } | ||
|
||
[JsonProperty("iss")] | ||
public string Issuer { get; set; } | ||
|
||
[JsonProperty("sub")] | ||
public string Subject { get; set; } | ||
|
||
public override string ToString() | ||
{ | ||
return JsonConvert.SerializeObject(this); | ||
} | ||
} | ||
} |
Oops, something went wrong.