Skip to content

Commit 485aeb0

Browse files
committed
chore: Update JWT authentication options in authentication documentation
This commit updates the options for JWT authentication in the authentication documentation. It clarifies the purpose and usage of each option, including `enabled`, `allowAnonymousEndpoints`, `certificate`, `algorithm`, `issuer`, `secretKey`, `expiry`, `validateLifetime`, `validAudience`, and `validateAudience`. The changes ensure that the documentation accurately reflects the functionality of the JWT authentication feature. Fixes #123
1 parent 9aad5b9 commit 485aeb0

File tree

6 files changed

+72
-57
lines changed

6 files changed

+72
-57
lines changed

content/en/library/authentication/index.md

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -161,26 +161,25 @@ To blacklist and deactivate the access tokens, use `IAccessTokenService` and inv
161161

162162
The default section name for the JWT settings is `jwt`. The following options are available:
163163

164-
`enabled` - if true then the JWT authentication is enabled.
164+
`enabled` - If true then the JWT authentication is enabled.
165165

166-
`allowAnonymousEndpoints` - if true then the JWT authentication is disabled for the endpoints with the AllowAnonymous attribute.
166+
`allowAnonymousEndpoints` - If true then the JWT authentication is disabled for the endpoints with the AllowAnonymous attribute.
167167

168-
`certificate` - certificate used to issue or just validate the tokens (including private key or just the public one).
168+
`certificate` - Certificate used to issue or just validate the tokens (including private key or just the public one).
169169

170-
`algorithm` - the algorithm used to sign the tokens.
170+
`algorithm` - The algorithm used to sign the tokens.
171171

172-
`issuer` - a party signing the tokens.
172+
`issuer` - A party signing the tokens.
173173

174-
`secretKey` - a secret key used to create the access tokens (instead of using the certificate).
174+
`secretKey` - A secret key used to create the access tokens (instead of using the certificate).
175175

176+
`expiry` - How long the token will remain valid.
176177

177-
`expiry` - how long the token will remain valid.
178+
`validateLifetime` - If true then the lifetime defined in expiryMinutes will be validated.
178179

179-
`validateLifetime` - if true then the lifetime defined in expiryMinutes will be validated.
180+
`validAudience` - An audience that can use the access tokens.
180181

181-
`validAudience` - an audience that can use the access tokens.
182-
183-
`validateAudience` - if true then the audience defined in validAudience will be validated.
182+
`validateAudience` - If true then the audience defined in validAudience will be validated.
184183

185184
## Settings
186185

@@ -238,14 +237,6 @@ The default section name for the JWT settings is `jwt`. The following options ar
238237
}
239238
```
240239

241-
242-
243-
244-
245-
246-
247-
248-
249240
### Default settings
250241

251242
Default settings for some variable has bee overwritten with the following configuration.

content/en/library/azure-key-vault/index.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,39 @@ dotnet add package Genocs.Secrets.AzureKeyVault
3737

3838
Extend Program.cs -> use WebHostBuilder or HostBuilder to setup the Azure Key Vault configuration.
3939

40+
You can use different ways to setup the Azure Key Vault.
41+
1. By using Managed Identity (User Assigned Managed Identity or System Assigned Managed Identity)
42+
2. By using RBAC (Role Based Access Control)
43+
3. By using Certificate
44+
45+
46+
#### Managed Identity or RBAC
4047
``` cs
4148
builder.Host
4249
.UseAzureKeyVault();
4350
```
4451

52+
#### Certificate
53+
``` cs
54+
builder.Host
55+
.UseAzureKeyVaultWithCertificate();
56+
```
57+
58+
4559
### Options
4660

4761
`enabled` - Enable or disable the Azure Key Vault configuration. Default is false
4862

4963
`name` - Sets the key vault name to be used. If the key vault url is `https://kyvault.vault.azure.net/` then the name is `kyvault`.
5064

51-
`managedIdentityId` - sets the managed identity id to be used. You can find the managed identity id in the Azure portal. The managed identity id is the object id of the managed identity.
65+
`managedIdentityId` - Sets the managed identity id to be used. You can find the managed identity id in the Azure portal. The managed identity id is the object id of the managed identity.
66+
67+
`azureADCertThumbprint` - The client id. To be used with Certificate authentication.
68+
69+
`azureADApplicationId` - The Active Directory Application id. To be used with Certificate authentication.
70+
71+
`azureADDirectoryId` - The Azure EntraID tenant Id. To be used with Certificate authentication.
72+
5273

5374
**NOTE:** In case of RBAC, you don't need to set the managed identity id.
5475

@@ -59,6 +80,9 @@ builder.Host
5980
"azureKeyVault": {
6081
"enabled": false,
6182
"name": "kyvault",
62-
"managedIdentityId": "your-managed-identity-id"
83+
"managedIdentityId": "your-managed-identity-id",
84+
"azureADCertThumbprint": "your-certificate-thumbprint",
85+
"azureADApplicationId": "your-application-id",
86+
"azureADDirectoryId": "your-directory-id"
6387
}
64-
```
88+
```

content/en/library/builder/index.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,15 @@ StaticLogger.EnsureInitialized();
6868
var builder = WebApplication.CreateBuilder(args);
6969

7070
builder.Host
71-
.UseLogging() // Use Serilog
72-
.UseAzureKeyVault(); // Use Azure Key Vault
71+
.UseAzureKeyVault() // Use Azure Key Vault
72+
.UseLogging(); // Use Serilog
7373
7474
// Get the services
7575
var services = builder.Services;
7676

7777
// Setup the builder
7878
services
79-
.AddGenocs(builder.Configuration) // Add Genocs
79+
.AddGenocs(builder.Configuration) // Setup Genocs builder
8080
.AddOpenTelemetry() // Add OpenTelemetry
8181
.AddMongoFast() // Add MongoDb
8282
.RegisterMongoRepositories(Assembly.GetExecutingAssembly()) // Register MongoDb Repositories
@@ -154,17 +154,17 @@ Log.CloseAndFlush();
154154

155155
## Options
156156

157-
`name` - the service name.
157+
`name` - The service name.
158158

159-
`service` - service name used TBW.
159+
`service` - Service name used TBW.
160160

161-
`instance` - the service instance.
161+
`instance` - The service instance.
162162

163-
`version` - service version.
163+
`version` - The service version.
164164

165-
`displayBanner` - if true then the banner is shown into the console.
165+
`displayBanner` - If true then the banner is shown into the console.
166166

167-
`displayVersion` - if true then the service version is shown into the console. See `version` param.
167+
`displayVersion` - If true then the service version is shown into the console. See `version` param.
168168

169169
## Settings
170170

content/en/library/distributed-tracing/index.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,21 +98,21 @@ public class MyClass
9898

9999
## Options
100100

101-
`enabled` - determines whether reporting is enabled.
101+
`enabled` - It determines whether reporting is enabled.
102102

103-
`serviceName` - name of the applciation that’s going to be used in Jaeger query engine.
103+
`serviceName` - The name of the application that’s going to be used in Jaeger query engine.
104104

105-
`udpHost` - host part of the Jaeger endpoint (UDP).
105+
`udpHost` - The host part of the Jaeger endpoint (UDP).
106106

107-
`udpPort` - port of the Jaeger endpoint (UDP).
107+
`udpPort` - The port of the Jaeger endpoint (UDP).
108108

109-
`maxPacketSize` - maximum size of the UDP header packet (by default 0). This is not required.
109+
`maxPacketSize` - Then maximum size of the UDP header packet (by default 0). This is not required.
110110

111111
`sampler` - The allowed values are: const, rate and probabilistic. For more details about sampling check the official Jaeger Docs.
112112

113-
`maxTracesPerSecond` - determines maximum number of reported traces per second. Required only for rate sampler.
113+
`maxTracesPerSecond` - It determines maximum number of reported traces per second. Required only for rate sampler.
114114

115-
`samplingRate` - determines the percentage of spans to report. Required only for probabilistic sampler.
115+
`samplingRate` - It determines the percentage of spans to report. Required only for probabilistic sampler.
116116

117117
## Settings
118118

content/en/library/http-client/index.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ public class SomeService
6868

6969
### Options
7070

71-
`type` - sets the IHttpClient message handler, if none is specified then the default handler will be used, other possible values: consul, fabio.
71+
`type` - It sets the IHttpClient message handler, if none is specified then the default handler will be used, other possible values: consul, fabio.
7272

73-
`retries` - number of HTTP request retries using an exponential backoff.
73+
`retries` - The number of HTTP request retries using an exponential backoff.
7474

75-
`services` - dictionary (map) of service_name:service_url values that can be used to invoke the other web services without a need to hardcode the configuration URLs, especially useful when service discovery mechanism or load balancer is available.
75+
`services` - The dictionary (map) of service_name:service_url values that can be used to invoke the other web services without a need to hardcode the configuration URLs, especially useful when service discovery mechanism or load balancer is available.
7676

7777
**appsettings.json**
7878

@@ -124,19 +124,19 @@ public static IGenocsBuilder RegisterGenocs(this IGenocsBuilder builder)
124124

125125
### Options
126126

127-
`enabled` - determines whether Consul integration is going to be available.
127+
`enabled` - It determines whether Consul integration is going to be available.
128128

129-
`url` - URL of the Consul service.
129+
`url` - The URL of the Consul service.
130130

131-
`service` - name of the service group (multiple instances of the same service will use the same service name).
131+
`service` - The name of the service group (multiple instances of the same service will use the same service name).
132132

133-
`address` - address of the service.
133+
`address` - The address of the service.
134134

135-
`port` - port under which the service is available.
135+
`port` - The port under which the service is available.
136136

137-
`pingEnabled` - register health checks from Consul to validate the service availability (if the service will be offline, it will be removed after the pingInterval and removeAfterInterval timeouts).
137+
`pingEnabled` - Register health checks from Consul to validate the service availability (if the service will be offline, it will be removed after the pingInterval and removeAfterInterval timeouts).
138138

139-
`pingEndpoint` - an endpoint that should be called when performing the healt check by Consul.
139+
`pingEndpoint` - The endpoint that is called when performing the health check by Consul.
140140

141141
**appsettings.json**
142142

@@ -192,11 +192,11 @@ public static IGenocsBuilder RegisterGenocs(this IGenocsBuilder builder)
192192

193193
### Options
194194

195-
`enabled` - determines whether Fabio integration is going to be available.
195+
`enabled` - It determines whether Fabio integration is going to be available.
196196

197-
`url` - URL of the Fabio service.
197+
`url` - The URL of the Fabio service.
198198

199-
`service` - name of the service group used for the Consul registration.
199+
`service` - the name of the service group used for the Consul registration.
200200

201201
**appsettings.json**
202202

content/en/library/security/index.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,17 @@ public static IWebHostBuilder GetWebHostBuilder(string[] args)
4040

4141
## Options
4242

43-
`enabled` - determines whether Vault integration is going to be available.
43+
`enabled` - It determines whether Vault integration is going to be available.
4444

45-
`url` - URL of the Vault service.
45+
`url` - The URL of the Vault service.
4646

47-
`authType` - authentication type, possible values: token, userpass.
47+
`authType` - The authentication type, possible values: token, userpass.
4848

49-
`token` - a secret token used to authenticate to Vault, used when authType = token.
49+
`token` - The secret token used to authenticate to Vault, used when authType = token.
5050

51-
`username` - name of the user used to authenticate to Vault, used when authType = userpass.
51+
`username` - The name of the user used to authenticate to Vault, used when authType = userpass.
5252

53-
`password` - password of the user used to authenticate to Vault, used when authType = userpass.
53+
`password` - The password of the user used to authenticate to Vault, used when authType = userpass.
5454

5555
`kv` - KV storage used for loading JSON settings during application startup.
5656

0 commit comments

Comments
 (0)