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

Token based authentication #2146

Open
johnbburg opened this issue Feb 23, 2023 · 2 comments
Open

Token based authentication #2146

johnbburg opened this issue Feb 23, 2023 · 2 comments

Comments

@johnbburg
Copy link

I'm not sure if I'm missing something, the default authentication method is username/password. Which uses basic auth within the URL. I don't see how I can use token based authentication here. e.g.

Authorization: Bearer private-XXXXXXXXXXXXXXX

I'm trying to use an Elastic cloud engine for searches, and these appear to require requests be authenticated with a bearer token in the header, and I just don't see how I can use this method. Am I missing something? Would that be the digest option?

@ruflin
Copy link
Owner

ruflin commented Feb 24, 2023

Elastic cloud engine

What do you mean by this exactly? I know there is API key authentication but where did you see the Bearer token?

I have not tested this, but I would assume you could add the Bearer token as header to the client and it should work: https://github.com/ruflin/Elastica/blob/8.x/src/Client.php#L168

@johnbburg
Copy link
Author

Thank you for the response.

I think they actually call it an App search engine, and yes, I mean a key.
That's a good thought, on using the headers, I will look into that. Although yesterday I switched to looking into their reach apps. But this approach may allow us to do what we need.

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

No branches or pull requests

2 participants