Skip to content

Commit 44fa6eb

Browse files
authored
Merge pull request #149 from ESA-APEx/fix_token_generation
token.md: fixes to token generation instructions
2 parents 540d6fd + 5561431 commit 44fa6eb

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

guides/token.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,23 @@ Now add a configuration for your project. This requires that you request a clien
3838

3939
You will need to provide the following project specific information:
4040

41-
* *apex_project_a* is simply the name of the configuration in OIDC agent, which you'll use whenever you need a token.
42-
* the client id, which in this example is: *project-a-catalogue-dev-api*
41+
* *apex_[project]* (e.g *apex_project_a*) is simply the name of the configuration in OIDC agent, which you'll use whenever
42+
you need a token.
43+
* the client id, which in this example is: *[project]-catalogue-prod* (e.g. *project-a-catalogue-prod*)
4344

4445
Adjust these inputs in the following command, and run it to generate a new configuration. This step only needs to
4546
happen once per device where you want to set up the agent.
4647

4748
```bash
48-
oidc-gen --pub apex_project_a --flow=device --client-id=project-a-catalogue-dev-api --iss=https://auth.apex.esa.int/realms/apex --scope=openid --redirect-url=""
49+
oidc-gen --pub apex_[project] --flow=device --client-id=[project]-catalogue-prod --iss=https://auth.apex.esa.int/realms/apex --scope=openid --redirect-url=""
4950
```
5051

5152
### 3a. Generate a token from command line
5253

5354
From now on, whenever an OIDC bearer token is needed, you can run the following command:
5455

5556
```bash
56-
oidc-token apex_project_a
57+
oidc-token apex_[project]
5758
```
5859

5960
### 3b. Generate a token from a Python script
@@ -66,15 +67,14 @@ of 'refresh tokens'.
6667

6768
import liboidcagent as agent
6869

69-
token, issuer, expires_at = agent.get_token_response("apex_project_a")
70+
token, issuer, expires_at = agent.get_token_response("apex_[project]")
7071
```
7172

72-
7373
## Machine to machine login via client credentials
7474

75-
While the interactive login is the most secure option, sometimes you require a long running script script or service to
75+
While the interactive login is the most secure option, sometimes you require a long running script script or service to
7676
interact with an instantiation service like the catalog. In this case, you can use the client credentials flow, which is
77-
basically a username/password login for machines.
77+
basically a username/password login for machines.
7878

7979
It is recommended to create such client credentials for each service separately, with minimal privileges. This allows you
8080
to retain granular access control, and to revoke access to a specific service without affecting others.

0 commit comments

Comments
 (0)