Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set auth-http plugin header in docker container? #190

Open
jayaraj opened this issue Jun 6, 2020 · 2 comments
Open

How to set auth-http plugin header in docker container? #190

jayaraj opened this issue Jun 6, 2020 · 2 comments
Labels

Comments

@jayaraj
Copy link

jayaraj commented Jun 6, 2020

I am not able to pass auth.http.header.Authorization from Docker environment variables. Is there any other method to specify the parameters

@wwhai wwhai changed the title EMQX_AUTH__HTTP__HEADER__AUTHORIZATION How to set auth-http plugin header? Oct 9, 2020
@wwhai
Copy link

wwhai commented Oct 9, 2020

I am not able to pass auth.http.header.Authorization from Docker environment variables. Is there any other method to specify the parameters

You can reference document here:https://github.com/emqx/emqx-rel/tree/master/deploy/docker, also same issue here:#204 (comment).

@wwhai wwhai changed the title How to set auth-http plugin header? How to set auth-http plugin header in docker container? Oct 9, 2020
@wwhai wwhai added the question label Oct 9, 2020
@flapezoti
Copy link

flapezoti commented May 19, 2021

I am facing the same issue. Were you able to solve it @jayaraj ?

I am using the docker image emqx/emqx:v4.2.9, I have tried to pass it as the following env var, but no luck:

EMQX_AUTH__HTTP__HEADER__AUTHORIZATION = "text"

The broker logs while starting up shows that it's not recognizing it

emqx          | auth.http.acl_req=host.docker.internal:8080/api/v1/authenticate
emqx          | auth.http.acl_req.method=post
emqx          | auth.http.acl_req.params=username=%u,topic=%t
emqx          | auth.http.auth_req=host.docker.internal:8080/api/v1/authenticate
emqx          | auth.http.auth_req.content_type=json
emqx          | auth.http.auth_req.method=post
emqx          | auth.http.auth_req.params=username=%u,password=%P
emqx          | cluster.autoclean=5m
emqx          | cluster.autoclean=5m

I've tried the above because it's what is determined in the plugin conf file:

https://github.com/emqx/emqx-auth-http/blob/master/etc/emqx_auth_http.conf#L156-L162

and in the doc for this version : https://docs.emqx.io/en/broker/v4.2/advanced/auth-http.html#http-request-information

but I've also tried to pass it as the doc says using the below, but it didn't work as well

EMQX_AUTH__HTTP__AUTH_REQ__HEADERS__AUTHORIZATION = "text" (realized the doc I was seeing was from a different version)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants