zitadel 3.0.13 copy "zitadel: ^3.0.13" to clipboard
zitadel: ^3.0.13 copied to clipboard

Dart package for ZITADEL relatet matters. Contains the compiled grpc service clients to access the ZITADEL API.

example/README.md

Examples #

There are several examples in this directory:

  • Fetching the user with a personal access token
  • Fetching the user with a service account JWT profile
  • grpc-web example when Dart Web is used
  • Flutter example with all platforms

Fetching the user with a personal access token #

This example shows how to fetch the user profile with a personal access token (PAT). It requires api access, which is implicitly given by the PAT. The full, runnable example can be found in access_token_api_access.dart.

In short, one needs to attach a MetadataProvider to the created client:

final auth = createAuthClient(zitadelApiUrl, metadataProviders: [accessTokenProvider(accessToken)]);
final response = await auth.getMyUser(GetMyUserRequest());

Fetching the user with a service account JWT profile #

This example shows how to fetch the user profile with a service account JWT profile. The JWT profile can be created in the ZITADEL console, just like the PAT. The profile includes a private RSA key for the service account to sign a JWT on behalf of the account. Then, the service account authenticates itself with the JWT. As a result, an access token is returned by ZITADEL, which can be used to access the API. The full example is available in service_account_api_access.dart.

final auth = createAuthClient(zitadelApiUrl, metadataProviders: [
  serviceAccountProvider(zitadelAudience, serviceAccount, AuthenticationOptions(apiAccess: true))
]);
final response = await auth.getMyUser(GetMyUserRequest());
2
likes
0
pub points
32%
popularity

Publisher

verified publishersmartive.ch

Dart package for ZITADEL relatet matters. Contains the compiled grpc service clients to access the ZITADEL API.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

fixnum, grpc, http, jose, protobuf

More

Packages that depend on zitadel