Skip to content

Commit 0cc362d

Browse files
committed
auth: fix formatting and some typos
1 parent 1e9071d commit 0cc362d

File tree

16 files changed

+144
-113
lines changed

16 files changed

+144
-113
lines changed

docs/auth/entra-id/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ NAIS simplifies this by providing a [login proxy](../explanations/README.md#logi
1818

1919
Your application is left with the responsibility to verify that inbound requests have valid [tokens](../explanations/README.md#tokens).
2020

21-
:dart: Learn how to [log in employees with Entra ID](how-to/login.md).
21+
:dart: [**Learn how to log in employees**](how-to/login.md)
2222

2323
## Secure your API
2424

@@ -27,7 +27,7 @@ Once configured, your consumers can acquire a token from Entra ID to [consume yo
2727

2828
Your application code must verify inbound requests by validating the included tokens.
2929

30-
:dart: Learn how to [secure your API with Entra ID](how-to/secure.md)
30+
:dart: [**Learn how to secure your API with Entra ID**](how-to/secure.md)
3131

3232
## Consume an API
3333

@@ -50,7 +50,7 @@ graph LR
5050

5151
The new token preserves the employee's identity context and is only valid for the specific API you want to access.
5252

53-
:dart: Learn how to [consume an API on behalf of an employee](how-to/consume-obo.md)
53+
:dart: [**Learn how to consume an API on behalf of an employee**](how-to/consume-obo.md)
5454

5555
### Consume as application
5656

@@ -65,4 +65,4 @@ graph LR
6565
Application --3. use token---> API["Other API"]
6666
```
6767

68-
:dart: Learn how to [consume an API as an application](how-to/consume-m2m.md)
68+
:dart: [**Learn how to consume an API as an application**](how-to/consume-m2m.md)

docs/auth/entra-id/how-to/consume-m2m.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
tags: [entra-id, azure-ad, how-to]
33
---
44

5-
# Consume internal API as an application using Entra ID
5+
# Consume internal API as an application
66

77
This how-to guides you through the steps required to consume an API secured with [Entra ID](../README.md):
88

docs/auth/entra-id/how-to/consume-obo.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
tags: [entra-id, azure-ad, how-to]
33
---
44

5-
# Consume internal API on behalf of an employee using Entra ID
5+
# Consume internal API on behalf of an employee
66

77
This how-to guides you through the steps required to consume an API secured with [Entra ID](../README.md) on behalf of an employee:
88

docs/auth/entra-id/how-to/login.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
tags: [entra-id, azure-ad, how-to]
33
---
44

5-
# Log in an employee with Entra ID
5+
# Log in an employee
66

77
{%- if tenant() == "nav" %}
88
!!! warning "Availability"

docs/auth/entra-id/how-to/secure.md

+1-23
Original file line numberDiff line numberDiff line change
@@ -22,29 +22,7 @@ Depending on who your consumers are, you must grant access to either application
2222

2323
### Applications
2424

25-
By default, no applications have access to your API.
26-
You must explicitly grant access to consumer applications.
27-
28-
```yaml title="app.yaml"
29-
spec:
30-
accessPolicy:
31-
inbound:
32-
rules:
33-
- application: app-a
34-
35-
- application: app-b
36-
namespace: other-namespace
37-
38-
- application: app-c
39-
namespace: other-namespace
40-
cluster: other-cluster
41-
```
42-
43-
The above configuration authorizes the following applications :
44-
45-
* application `app-a` running in the same namespace and same cluster as your application
46-
* application `app-b` running in the namespace `other-namespace` in the same cluster
47-
* application `app-c` running in the namespace `other-namespace` in the cluster `other-cluster`
25+
{% include 'auth/entra-id/partials/app-access.md' %}
4826

4927
### Users
5028

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
By default, no applications have access to your API.
2+
You must explicitly grant access to consumer applications.
3+
4+
```yaml title="app.yaml" hl_lines="5-12"
5+
spec:
6+
accessPolicy:
7+
inbound:
8+
rules:
9+
- application: app-a
10+
11+
- application: app-b
12+
namespace: other-namespace
13+
14+
- application: app-c
15+
namespace: other-namespace
16+
cluster: other-cluster
17+
```
18+
19+
The above configuration authorizes the following applications:
20+
21+
* application `app-a` running in the same namespace and same cluster as your application
22+
* application `app-b` running in the namespace `other-namespace` in the same cluster
23+
* application `app-c` running in the namespace `other-namespace` in the cluster `other-cluster`
+12-12
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
11
By default, no users have access to your application.
22
You must explicitly grant access to either [specific groups](#groups), [all users](#all-users), or both.
33

4-
#### All users
5-
6-
The following configuration grants _all_ users access your application:
7-
8-
```yaml hl_lines="5" title="app.yaml"
9-
spec:
10-
azure:
11-
application:
12-
enabled: true
13-
allowAllUsers: true
14-
```
15-
164
#### Groups
175

186
The following configuration only grants users that are _direct_ members of the specified groups access to your application:
@@ -32,3 +20,15 @@ spec:
3220
3321
Invalid [group identifiers](../explanations/README.md#group-identifier) are skipped and will not be granted access to your application.
3422
Ensure that they are correct and exist in Entra ID.
23+
24+
#### All users
25+
26+
The following configuration grants _all_ users access your application:
27+
28+
```yaml hl_lines="5" title="app.yaml"
29+
spec:
30+
azure:
31+
application:
32+
enabled: true
33+
allowAllUsers: true
34+
```

docs/auth/entra-id/partials/validate.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Validate that the `aud` claim is equal to the `AZURE_APP_CLIENT_ID` environment
1919

2020
**Signature Validation**
2121

22-
Validate that the token is signed with a ID-porten's public key published at the JWKS endpoint.
22+
Validate that the token is signed with a public key published at the JWKS endpoint.
2323
This endpoint URI can be found in one of two ways:
2424

2525
1. the `AZURE_OPENID_CONFIG_JWKS_URI` environment variable, or

docs/auth/entra-id/reference/README.md

+61-30
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ tags: [entra-id, azure-ad, reference]
66

77
## Access policies
88

9+
### Applications
10+
11+
{% include 'auth/entra-id/partials/app-access.md' %}
12+
13+
### Users
14+
15+
{% include 'auth/entra-id/partials/user-access.md' %}
16+
17+
### Fine-grained permissions
18+
919
You may define custom permissions for your application in Entra ID and grant them to other consumer applications.
1020
Permissions will appear as _claims_ in the consumer's token.
1121
Your application can then use these claims to implement custom authorization logic.
@@ -21,7 +31,7 @@ Your application can then use these claims to implement custom authorization log
2131
2. The consumer has been granted a custom permission in your access policy definition.
2232
3. The target _audience_ is your application.
2333

24-
### Custom scopes
34+
#### Custom scopes
2535

2636
A _scope_ only applies to tokens acquired [on behalf of an employee][obo]
2737
(service-to-service calls on behalf of an end-user).
@@ -74,7 +84,7 @@ Scopes will appear as a _space separated string_ in the `scp` claim within the u
7484
}
7585
```
7686

77-
### Custom roles
87+
#### Custom roles
7888

7989
A _role_ only applies to tokens acquired [as an application][m2m] (service-to-service calls).
8090

@@ -128,28 +138,43 @@ Roles will appear in the `roles` claim as an _array of strings_ within the appli
128138

129139
Notable claims in tokens from Entra ID:
130140

131-
- `azp` (**authorized party**)
132-
- The [client ID](../explanations/README.md#client-id) of the application that requested the token (this would be your consumer).
133-
- `azp_name` (**authorized party name**)
134-
- The value of this claim is the (human-readable) [name](../explanations/README.md#client-name) of the consumer application that requested the token.
135-
- `groups` (**groups**)
136-
- JSON array of [group identifiers](../explanations/README.md#group-identifier) that the user is a member of.
137-
- Used to implement group-based authorization logic in your application.
138-
- This claim only applies in flows where a user is involved i.e., either the [login] or [on-behalf-of][obo] flows.
139-
- In order for a group to appear in the claim, all the following conditions must be true:
140-
- The given user is a direct member of the group.
141-
- The group has been [granted access to the application](../how-to/secure.md#users).
142-
- `idtyp` (**identity type**)
143-
- This is a special claim used to determine whether a token is a [machine-to-machine][m2m] (app-only) token or a [on-behalf-of][obo] (user) token.
144-
- The claim currently only appears in machine-to-machine tokens. The value is `app` when the token is a machine-to-machine token.
145-
- In short: if the `idtyp` claim exists and it has the value `app`, then it is a machine-to-machine token. Otherwise, it is a user/on-behalf-of token.
141+
`azp` (**authorized party**)
142+
143+
: The [client ID](../explanations/README.md#client-id) of the application that requested the token (this would be your consumer).
144+
145+
`azp_name` (**authorized party name**)
146+
147+
: The value of this claim is the (human-readable) [name](../explanations/README.md#client-name) of the consumer application that requested the token.
148+
149+
`groups`
150+
151+
: JSON array of [group identifiers](../explanations/README.md#group-identifier) that the user is a member of.
152+
Used to implement group-based authorization logic in your application.
153+
154+
This claim only applies in flows where a user is involved i.e., either the [login] or [on-behalf-of][obo] flows.
155+
In order for a group to appear in the claim, all the following conditions must be true:
156+
157+
- The given user is a direct member of the group.
158+
- The group has been [granted access to the application](../how-to/secure.md#users).
159+
160+
`idtyp` (**identity type**)
161+
162+
: This is a special claim used to determine whether a token is a [machine-to-machine][m2m] (app-only) token or a [on-behalf-of][obo] (user) token.
163+
164+
Tokens are a machine-to-machine tokens only if this claim exists and has the value `app`.
165+
146166
{%- if tenant() == "nav" %}
147-
- `NAVident` (**NAV ident**)
148-
- The value of this claim maps to an internal identifier for the employees in NAV.
149-
- This claim thus only applies in flows where a user is involved i.e., either the [login] or [on-behalf-of][obo] flows.
167+
168+
`NAVident`
169+
170+
: The internal identifier for the employees in NAV.
171+
Only applies in flows where a user is involved i.e., either the [login] or [on-behalf-of][obo] flows.
172+
150173
{%- endif %}
151-
- `roles` (**roles**)
152-
- The value of this claim is an _array of strings_ that lists the roles that the application has access to:
174+
175+
`roles`
176+
177+
: The value of this claim is an _array of strings_ that lists the roles that the application has access to:
153178
```json
154179
{
155180
"roles": [
@@ -159,19 +184,25 @@ Notable claims in tokens from Entra ID:
159184
]
160185
}
161186
```
162-
- This claim **only** applies to [machine-to-machine][m2m] tokens.
163-
- Consumers defined in the [access policy](../how-to/secure.md#applications) are always assigned the default role named `access_as_application`.
164-
- You can optionally define and grant additional [custom roles](#custom-roles) to consumers.
165-
- `scp` (**scope**)
166-
- The value of this claim is a _space-separated string_ that lists the scopes that the application has access to:
187+
188+
This claim **only** applies to [machine-to-machine][m2m] tokens.
189+
190+
Consumers defined in the [access policy](../how-to/secure.md#applications) are always assigned the default role named `access_as_application`.
191+
You can optionally define and grant them [custom roles](#custom-roles).
192+
193+
`scp` (**scope**)
194+
195+
: The value of this claim is a _space-separated string_ that lists the scopes that the application has access to:
167196
```json
168197
{
169198
"scp": "defaultaccess scope1 scope2"
170199
}
171200
```
172-
- This claim **only** applies to user or [on-behalf-of][obo] tokens.
173-
- Consumers defined in the [access policy](../how-to/secure.md#applications) are always assigned the default scope named `defaultaccess`.
174-
- You can optionally define and grant additional [custom scopes](#custom-scopes) to consumers.
201+
202+
This claim **only** applies to user or [on-behalf-of][obo] tokens.
203+
204+
Consumers defined in the [access policy](../how-to/secure.md#applications) are always assigned the default scope named `defaultaccess`.
205+
You can optionally define and grant them [custom scopes](#custom-scopes).
175206

176207
For a complete list of claims, see the [Access Token Claims Reference in Entra ID](https://learn.microsoft.com/en-us/entra/identity-platform/access-token-claims-reference).
177208
We only use v2.0 tokens.

docs/auth/idporten/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ NAIS simplifies this by providing a [login proxy](../explanations/README.md#logi
1717

1818
Your application is left with the responsibility to verify that inbound requests have valid tokens.
1919

20-
:dart: Learn how to [log in citizens with ID-porten](how-to/login.md).
20+
:dart: [**Learn how to log in citizens**](how-to/login.md)

docs/auth/idporten/how-to/login.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
tags: [idporten, how-to]
33
---
44

5-
# Log in a citizen with ID-porten
5+
# Log in a citizen
66

77
This how-to guides you through the steps required to ensure that only citizens authenticated with [ID-porten](../README.md) can access your application.
88

@@ -75,7 +75,7 @@ Validate that the `aud` claim is equal to the `IDPORTEN_AUDIENCE` environment va
7575

7676
**Signature Validation**
7777

78-
Validate that the token is signed with a ID-porten's public key published at the JWKS endpoint.
78+
Validate that the token is signed with a public key published at the JWKS endpoint.
7979
This endpoint URI can be found in one of two ways:
8080

8181
1. the `IDPORTEN_JWKS_URI` environment variable, or

docs/auth/idporten/reference/README.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@ tags: [idporten, reference]
88

99
Notable claims in tokens from ID-porten:
1010

11-
- `acr` (**Authentication Context Class Reference**)
12-
- The [security level](#security-levels) used for authenticating the end-user.
13-
- `pid` (**personidentifikator**)
14-
- The Norwegian national ID number (fødselsnummer/d-nummer) of the authenticated end user.
11+
`acr`
12+
13+
: The [security level](#security-levels) used when authenticating the end-user.
14+
15+
`pid`
16+
17+
: "Personidentifikator". The Norwegian national ID number (fødselsnummer/d-nummer) of the authenticated end user.
1518

1619
For a complete list of claims, see the [Access Token Reference in ID-porten](https://docs.digdir.no/docs/idporten/oidc/oidc_protocol_access_token#by-value--self-contained-access-token).
1720

docs/auth/maskinporten/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ graph LR
2222
Consumer --3. use token---> API["External API"]
2323
```
2424

25-
:dart: Learn how to [consume an external API using Maskinporten](how-to/consume.md)
25+
:dart: [**Learn how to consume an external API using Maskinporten**](how-to/consume.md)
2626

2727
## Secure your API
2828

@@ -32,4 +32,4 @@ Once configured, your consumers can acquire a token from Maskinporten to [consum
3232

3333
Your application code must verify inbound requests by validating the included tokens.
3434

35-
:dart: Learn how to [secure your API with Maskinporten](how-to/secure.md)
35+
:dart: [**Learn how to secure your API with Maskinporten**](how-to/secure.md)

0 commit comments

Comments
 (0)