I have created a Core Content Management Service Client with auth type Client Secrete and I keep getting the same error {"fault":{"faultstring":"Invalid ApiKey","detail":{"errorcode":"oauth.v2.InvalidApiKey"}}}.
I have validated the tenant ID, client ID and client secrete a number of times as well…
I have tried a number of different service client configurations but I keep getting the same error. I think the error message is a generic message as there is no API key for the auth type of client secrete. Any suggestions would be great to help fix this.
Here is an example snippet of the API call being made:
private static async Task<TokenResponse> GetServiceTokenAsync(
string region, string tenantId, string clientId, string clientSecret, CancellationToken ct = default)
{
var tokenUrl = $"https://{region}.api.opentext.com/tenants/{tenantId}/oauth2/token";
using var req = new HttpRequestMessage(HttpMethod.Post, tokenUrl);
var jsonBody = new
{
client_id = clientId,
client_secret = clientSecret,
grant_type = "client_credentials"
};
req.Content = new StringContent(
JsonSerializer.Serialize(jsonBody),
Encoding.UTF8,
"application/json"
);
using var http = new HttpClient();
using var resp = await http.SendAsync(req, ct);
var body = await resp.Content.ReadAsStringAsync(ct); // get the error in the body here
The one thing i did see is on this OT doc that a "Core Content Developer plan" is required - would this be listed under the Admin Center apps? Not sure if this is required for simple auth into the tenant or not…
Thanks.