Description
This is the code we use
def client_id
ENV["AZURE_APPLICATION_CLIENT_ID"]
end
def client_secret
ENV["AZURE_APPLICATION_CLIENT_SECRET"]
end
def client
@client ||= OAuth2::Client.new(
client_id,
client_secret,
site: "https://login.microsoftonline.com/",
token_url: "common/oauth2/v2.0/token",
authorize_url: "common/oauth2/v2.0/authorize",
)
end
And this is the endpoint call that fails
openid_configuration = client.request(:get, "/common/v2.0/.well-known/openid-configuration")
Edit 10:48am:
This is innacurate, I found that it is a different code path that fails, running in debug mode I get this error instead
E, [2025-05-20T10:47:36.325610 #23904] ERROR -- omniauth: (microsoft_graph) Authentication failure! undefined method '+' for nil: NoMethodError, undefined method '+' for nil
In 2.0.9 it works perfectly fine, in 2.0.10 it returns this error
E, [2025-05-20T08:53:25.904180 #14849] ERROR -- omniauth: (microsoft_graph) Authentication failure! invalid_credentials: OAuth2::Error, invalid_client: AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app '2420f2a9-XXXXX'. Trace ID: 9f152d9e-b7bf-4ff0-8987-e12ff63d5b01 Correlation ID: 61c457e0-e704-4037-8704-6ba5b138c59e Timestamp: 2025-05-20 15:53:25Z
{"error":"invalid_client","error_description":"AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app '2420f2a9-XXXXX'. Trace ID: 9f152d9e-b7bf-4ff0-8987-e12ff63d5b01 Correlation ID: 61c457e0-e704-4037-8704-6ba5b138c59e Timestamp: 2025-05-20 15:53:25Z","error_codes":[7000215],"timestamp":"2025-05-20 15:53:25Z","trace_id":"9f152d9e-b7bf-4ff0-8987-e12ff63d5b01","correlation_id":"61c457e0-e704-4037-8704-6ba5b138c59e","error_uri":"https://login.microsoftonline.com/error?code=7000215"}