authenticate method

Future<String?> authenticate(
  1. RoomClient client,
  2. RemoteParticipant agent,
  3. Uri redirectUri
)

Implementation

Future<String?> authenticate(RoomClient client, RemoteParticipant agent, Uri redirectUri) async {
  if (server.openaiConnectorId != null || oauth != null) {
    return await client.secrets.requestOAuthToken(
      fromParticipantId: client.localParticipant!.id,
      connector: server.openaiConnectorId == null ? null : ConnectorRef(openaiConnectorId: server.openaiConnectorId!),
      oauth: server.openaiConnectorId != null ? null : oauth,
      redirectUri: redirectUri,
      delegateTo: agent.getAttribute("name"),
    );
  } else {
    return null;
  }
}