mirror of
https://github.com/zitadel/zitadel.git
synced 2025-01-09 17:23:41 +00:00
docs: change scope for zitadel audience (#9117)
# Which Problems Are Solved - This replaces the old aud claim from Zitadel in two places. # Additional Context - Relates to [this discord thread](https://discord.com/channels/927474939156643850/1305853084743766067)
This commit is contained in:
parent
c687d6769b
commit
a54bb2977b
@ -43,11 +43,10 @@ dotnet add package Zitadel.Api
|
|||||||
### Create example client
|
### Create example client
|
||||||
|
|
||||||
Change the program.cs file to the content below. This will create a client for the management api and call its `GetMyUsers` function.
|
Change the program.cs file to the content below. This will create a client for the management api and call its `GetMyUsers` function.
|
||||||
The SDK will make sure you will have access to the API by retrieving a Bearer Token using JWT Profile with the provided scopes (`openid` and `urn:zitadel:iam:org:project:id:{projectID}:aud`).
|
The SDK will make sure you will have access to the API by retrieving a Bearer Token using JWT Profile with the provided scopes (`openid` and `urn:zitadel:iam:org:project:id:zitadel:aud`).
|
||||||
|
|
||||||
Make sure to fill the const `apiUrl`, `apiProject` and `personalAccessToken` with your own instance data. The used vars below are from a test instance, to show you how it should look.
|
Make sure to fill the const `apiUrl`, and `personalAccessToken` with your own instance data. The used vars below are from a test instance, to show you how it should look.
|
||||||
The apiURL is the domain of your instance you can find it on the instance detail in the Customer Portal or in the Console
|
The apiURL is the domain of your instance you can find it on the instance detail in the Customer Portal or in the Console
|
||||||
The apiProject you will find in the ZITADEL project in the first organization of your instance.
|
|
||||||
|
|
||||||
```csharp
|
```csharp
|
||||||
// This file contains two examples:
|
// This file contains two examples:
|
||||||
@ -66,7 +65,8 @@ var client = Clients.AuthService(new(apiUrl, ITokenProvider.Static(personalAcces
|
|||||||
var result = await client.GetMyUserAsync(new());
|
var result = await client.GetMyUserAsync(new());
|
||||||
Console.WriteLine($"User: {result.User}");
|
Console.WriteLine($"User: {result.User}");
|
||||||
|
|
||||||
const string apiProject = "170078979166961921";
|
// This adds the urn:zitadel:iam:org:project:id:zitadel:aud scope to the authorization request, enabling access to ZITADEL APIs.
|
||||||
|
const string apiProject = "zitadel";
|
||||||
var serviceAccount = ServiceAccount.LoadFromJsonString(
|
var serviceAccount = ServiceAccount.LoadFromJsonString(
|
||||||
@"
|
@"
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user