getKnowledgeConnectorsByProviderCallbackWithHttpInfo method
CompleteConnectorOAuth finishes an OAuth connection: it exchanges the provider's code for a token, seals that token in KMS, and records the connection.
CompleteConnectorOAuth finishes an OAuth connection: it exchanges the provider's code for a token, seals that token in KMS, and records the connection. THE ORG COMES FROM THE SIGNED STATE, not from a header and not from the provider, so an attacker cannot bind their own account to someone else's org — a tampered, expired or foreign-provider state is refused outright. The token itself is never returned, never written into the document, and never logged; the document holds only its KMS path.
Note: This method returns the HTTP Response.
Parameters:
-
String provider (required): Provider is the connector completing its flow, from the path.
-
String code: Code is the provider's authorization code, exchanged for a token.
-
String state: State is the org-bound value this server signed at connect time.
-
String error: Error is the provider's denial reason when the user refused consent.
Implementation
Future<Response> getKnowledgeConnectorsByProviderCallbackWithHttpInfo(String provider, { String? code, String? state, String? error, }) async {
// ignore: prefer_const_declarations
final path = r'/v1/knowledge/connectors/{provider}/callback'
.replaceAll('{provider}', provider);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
if (code != null) {
queryParams.addAll(_queryParams('', 'code', code));
}
if (state != null) {
queryParams.addAll(_queryParams('', 'state', state));
}
if (error != null) {
queryParams.addAll(_queryParams('', 'error', error));
}
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}