ServiceAccount class

A service account for ZITADEL. The service account can be loaded from a valid JSON string or from a file containing the JSON string. The account is used to communicate with the ZITADEL API and may serve as access token provider for a gRPC service client.

The service account can be used with the provided access rights in ZITADEL. If you want to use the ZITADEL API itself (for example to manage organizations), you need to authenticate with AuthenticationOptions.apiAccess set to true.

To create a service account json, head over to your ZITADEL console and execute the following steps:

  • create a Service User in your organization
  • Give the service user the relevant authorization (e.g. ORG_OWNER or access to a specific project)
  • Create a "key" in the account detail page of the service user and download it

Constructors

ServiceAccount.fromJson(Map<String, dynamic> json)
Load a service account from a JSON map.
ServiceAccount.fromJsonString(String json)
Load a service account from a JSON string.

Properties

hashCode int
The hash code for this object.
no setterinherited
key String
The private RSA key of the application. Used to sign the JWT.
final
keyId String
The ID of the RSA key.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
userId String
The ID of the service account in ZITADEL.
final

Methods

authenticate(String audience, [AuthenticationOptions? options]) Future<String>
Authenticates the ServiceAccount against the provided audience (or issuer) to fetch an access token. To authenticate with special options, use the options parameter.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Create a JSON map from the application.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

type → const String
The type of the object.