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

Added Support for Token Authorization #3

Open
MikeSQ opened this issue Jan 11, 2021 · 1 comment
Open

Added Support for Token Authorization #3

MikeSQ opened this issue Jan 11, 2021 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@MikeSQ
Copy link

MikeSQ commented Jan 11, 2021

On the wiki it appears to support either the global API key or custom API tokens. We tried creating a custom token that I have confirmed works using postman, however it does not work when we use it in the plugin.

Looking at the code, it appears to only support the api key method which requires a Key/Email combination and does not use the Authorization header that the tokens use.

        private Dictionary<string, string> GetCustomHeaders(Settings moduleSettings)
        {
            var newHeaders = new Dictionary<string, string>
            {
                {"X-Auth-Key", moduleSettings.ApiToken}, 
                {"X-Auth-Email", moduleSettings.Email}
            };

            return newHeaders;
        }

Am I missing something? If it weren't for the docs I would have assumed it doesn't currently support the token method, however since the docs not only mention the token method but recommend it I feel like I've missed something obvious.

@WillStrohl
Copy link
Contributor

I didn't fully look into the other method of authorization in this one. Nice find and PR. Thanks!

@WillStrohl WillStrohl changed the title Question about usage Added Support for Token Authorization Sep 30, 2021
@WillStrohl WillStrohl added this to the 01.01.00 milestone Sep 30, 2021
@WillStrohl WillStrohl added the enhancement New feature or request label Sep 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants