updateWorkspaceAuthentication method

Future<UpdateWorkspaceAuthenticationResponse> updateWorkspaceAuthentication({
  1. required List<AuthenticationProviderTypes> authenticationProviders,
  2. required String workspaceId,
  3. SamlConfiguration? samlConfiguration,
})

Use this operation to define the identity provider (IdP) that this workspace authenticates users from, using SAML. You can also map SAML assertion attributes to workspace user information and define which groups in the assertion attribute are to have the Admin and Editor roles in the workspace.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter authenticationProviders : Specifies whether this workspace uses SAML 2.0, IAM Identity Center, or both to authenticate users for using the Grafana console within a workspace. For more information, see User authentication in Amazon Managed Grafana.

Parameter workspaceId : The ID of the workspace to update the authentication for.

Parameter samlConfiguration : If the workspace uses SAML, use this structure to map SAML assertion attributes to workspace user information and define which groups in the assertion attribute are to have the Admin and Editor roles in the workspace.

Implementation

Future<UpdateWorkspaceAuthenticationResponse> updateWorkspaceAuthentication({
  required List<AuthenticationProviderTypes> authenticationProviders,
  required String workspaceId,
  SamlConfiguration? samlConfiguration,
}) async {
  final $payload = <String, dynamic>{
    'authenticationProviders':
        authenticationProviders.map((e) => e.value).toList(),
    if (samlConfiguration != null) 'samlConfiguration': samlConfiguration,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/workspaces/${Uri.encodeComponent(workspaceId)}/authentication',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateWorkspaceAuthenticationResponse.fromJson(response);
}