Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
opensearch-dashboards helm chart 2.6.0
opensearch helm chart 2.8.0
Describe the issue:
When configuring Azure as a IdP for OIDC I get a BadCredentialsException (see below)
and in the browser it says ‘{“statusCode”:401,“error”:“Unauthorized”,“message”:“Unauthorized”}’
To Reproduce
Steps to reproduce the behavior:
- configure openid in plugins/opensearch-security/securityconfig/config.yml
- configure openid in config/opensearch_dashboard.yml as described at OpenID Connect - OpenSearch documentation
- run plugins/opensearch-security/tools/securityadmin.sh
- open dashboard site in browser
Configuration:
opensearch_security:
multitenancy:
enabled: true
tenants:
preferred: ['Global', 'Private']
readonly_mode.roles: ['kibana_read_only']
auth:
type: "openid"
openid:
connect_url: https://login.microsoftonline.com/<mypath>/v2.0/.well-known/openid-configuration
client_id: <myid>
client_secret: <mysecret>
root_ca: /etc/ssl/certs/ca-certificates.crt
base_redirect_url: https://myserver
scope: openid profile email
openid_auth_domain:
http_enabled: true
transport_enabled: false
order: 2
http_authenticator:
type: openid
challenge: false
config:
subject_key: email
# roles_key: roles
openid_connect_url: https://login.microsoftonline.com/<mypath>/v2.0/.well-known/openid-configuration
openid_connect_idp:
enable_ssl: true
verify_hostnames: false
pemtrustedcas_filepath: /etc/ssl/certs/ca-certificates.crt
authentication_backend:
type: noop
Relevant Logs or Screenshots:
...
[2022-11-23T15:31:32,591][WARN ][o.o.s.h.HTTPBasicAuthenticator] [opensearch-cluster-master-1] No 'Basic Authorization' header, send 401 and 'WWW-Authenticate Basic'
--
Wed, Nov 23 2022 4:31:32 pm | [2022-11-23T15:31:32,593][INFO ][c.a.d.a.h.j.AbstractHTTPJwtAuthenticator] [opensearch-cluster-master-1] Extracting JWT token from eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IjJaUXBKM1VwYmpBWVhZR2FYRUpsOGxWMFRPSSJ9.<mytoken>.M5418NxLO5eA0cEYIoID-hzRJ6XcTZQJoMNEMzl_2sGOGYurN8FOIOgSedpm5cG6dQIsRoMMYS0GVvUvglxurU5J0TnJ7eCNN_1hfQ0TaHvGkDxX97HTm8bN1XGQrj8a0fjY8-f46H33HpT1OrRL-rM4vxYPIpg_8QfgllyB2Yh4-RDINSCgHiNgD7uH8Bk4pNzD4Y-mDb5xQdxFj0u2rEMqeKVCI_VaiIa-8i0C01xP_tpVRyX_fojfUcUE-7vUx-dy7mOYySSJM_UFBslvs2FCO7GEe6hwohVV18wmQXuh19cu0jpdTuW4XrGCiiyB4mo7qMlP674fdR3vYuACqA failed
Wed, Nov 23 2022 4:31:32 pm | com.amazon.dlic.auth.http.jwt.keybyoidc.BadCredentialsException: Algorithm of JWT does not match algorithm of JWK (HS512 != RS256)
Wed, Nov 23 2022 4:31:32 pm | at com.amazon.dlic.auth.http.jwt.keybyoidc.JwtVerifier.validateSignatureAlgorithm(JwtVerifier.java:90) ~[opensearch-security-2.4.0.0.jar:2.4.0.0]
...