Connecting to Graylog using AzureAD

I’m creating a Graylog cluster and i would like to authenticate to Graylog using AzureAD.
I’v already created an authentication on Graylog and an Application registrations on azureAD with the callback address…
The problem occurs when i try to login to graylog using my AzureAD account I got an error message and that message in logs:

2022-01-20T14:46:10.454+01:00 ERROR [OauthRequestUtils] Error attempting to fetch data from auth server. Got: 401 Unauthorized
2022-01-20T14:46:10.455+01:00 ERROR [OauthAuthServiceBackend] Unable to extract id and access tokens from JSON response
java.lang.NullPointerException: null
        at ~[?:?]
        at ~[?:?]
        at ~[?:?]
        at ~[graylog.jar:?]
        at ~[graylog.jar:?]
        at ~[graylog.jar:?]
        at ~[graylog.jar:?]
        at org.apache.shiro.realm.AuthenticatingRealm.getAuthenticationInfo( ~[graylog.jar:?]
        at org.apache.shiro.authc.pam.ModularRealmAuthenticator.doMultiRealmAuthentication( ~[graylog.jar:?]
        at org.apache.shiro.authc.pam.ModularRealmAuthenticator.doAuthenticate( ~[graylog.jar:?]
        at org.apache.shiro.authc.AbstractAuthenticator.authenticate( ~[graylog.jar:?]
        at org.apache.shiro.mgt.AuthenticatingSecurityManager.authenticate( ~[graylog.jar:?]
        at org.apache.shiro.mgt.DefaultSecurityManager.login( ~[graylog.jar:?]
        at ~[graylog.jar:?]
        at ~[graylog.jar:?]
        at ~[graylog.jar:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke( ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke( ~[?:?]
        at java.lang.reflect.Method.invoke( ~[?:?]
        at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0( ~[graylog.jar:?]
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$ [graylog.jar:?]
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke( [graylog.jar:?]
        at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch( [graylog.jar:?]
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch( [graylog.jar:?]
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke( [graylog.jar:?]
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply( [graylog.jar:?]
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply( [graylog.jar:?]
        at org.glassfish.jersey.server.ServerRuntime$ [graylog.jar:?]
        at org.glassfish.jersey.internal.Errors$ [graylog.jar:?]
        at org.glassfish.jersey.internal.Errors$ [graylog.jar:?]
        at org.glassfish.jersey.internal.Errors.process( [graylog.jar:?]
        at org.glassfish.jersey.internal.Errors.process( [graylog.jar:?]
        at org.glassfish.jersey.internal.Errors.process( [graylog.jar:?]
        at org.glassfish.jersey.process.internal.RequestScope.runInScope( [graylog.jar:?]
        at org.glassfish.jersey.server.ServerRuntime.process( [graylog.jar:?]
        at org.glassfish.jersey.server.ApplicationHandler.handle( [graylog.jar:?]
        at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service( [graylog.jar:?]
        at org.glassfish.grizzly.http.server.HttpHandler$ [graylog.jar:?]
        at com.codahale.metrics.InstrumentedExecutorService$ [graylog.jar:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker( [?:?]
        at java.util.concurrent.ThreadPoolExecutor$ [?:?]
        at [?:?]
2022-01-20T14:46:10.468+01:00 WARN  [BearerTokenRealm] Failed to authenticate username <<token>> with backend <Azure_authentication/oidcXXXXXXXXXXXXXXXXXXXX>
2022-01-20T14:46:10.470+01:00 INFO  [SessionCreator] Invalid credentials in session create request. Actor: "urn:graylog:node:XXXXXXXXXXXXXXXXXXXXXXXXX"

Graylog 4.2.5+59802bf on localhost (Debian 11.0.13 on Linux 5.10.0-9-amd64

I already tried to configure the token configuration on Azure but that didn’t help.

Could you help me to understand the messagei got int my logs.

Thank you!

Hello @Minwyyn

I grabbed the meaningful data from those logs to simplify on how to resolve this issue.

Error attempting to fetch data from auth server.

unable to extract id and access tokens from JSON response
java.lang.NullPointerException: null

Failed to authenticate username <> with backend <Azure_authentication/oidcXXXXXXXXXXXXXXXXXXXX>

Invalid credentials in session create request. Actor: “urn:graylog:node:XXXXXXXXXXXXXXXXXXXXXXXXX”

Need to ask some questions.

How did you configure Authentication Service - Active Directory?
Did you test this in the Graylog Web UI which is under System/Authentication?
What have you done to resolve this issue so far?

Hi, I solved my problem now everything is good

For those who wants to know I just used$tenant/ that showed me in the logs that i needed to give access to the email from the Azure response. Then I made that modification in Azure and put the url back to normal and everything was working fine. I just needed to add a few options to make it works

Thank you @gsmith for your answer

1 Like

Glad you solved your issue.
If you could mark this as resolved that would be great for future searchs :+1:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.