Skip to content

updated How to Authenticate Users with API Keys #6157

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

Closed
wants to merge 2 commits into from
Closed

updated How to Authenticate Users with API Keys #6157

wants to merge 2 commits into from

Conversation

gondo
Copy link
Contributor

@gondo gondo commented Jan 16, 2016

supportsToken should be defined above authenticateToken to reflect documentation numbering

onAuthenticationFailure should return http code 401 Unauthorized (RFC 7235) not 403 Forbidden.

added missing information about defining access_control - figuring this out kept me hanging for a while

used ROLE_API instead of ROLE_USER to demonstrate access_control configuration

`supportsToken` should be defined above `authenticateToken` to reflect documentation numbering

`onAuthenticationFailure` should return http code 401 Unauthorized (RFC 7235) not 403 Forbidden.

added missing information about defining `access_control` - figuring this out kept me hanging for a while

used `ROLE_API` instead of `ROLE_USER` to demonstrate `access_control` configuration
@gondo gondo changed the title fixes updated How to Authenticate Users with API Keys Jan 16, 2016
removed message from BadCredentialsException as defining custom message is confusing, because `onAuthenticationFailure` is using `getMessageKey()` instead of `getMessage()`
@@ -434,6 +435,46 @@ using the ``simple_preauth`` and ``provider`` keys respectively:
),
));

If you have defined `access_control`, make sure to add new entry:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be enclosed by double instead of single backticks.

@xabbuh
Copy link
Member

xabbuh commented May 21, 2016

@gondo I left a minor comment. Can you fix that and also rebase here (otherwise we can do that while merging)? This should be mergeable then.

@wouterj
Copy link
Member

wouterj commented Jul 2, 2016

Hi @gondo! Thank you for starting this PR. I'm very sorry for the long inactivity on our side here. I've rebased your pull request and made another minor change. For this, I created a new PR: #6706 I've kept your commits, so you'll still get all credits you deserve.

Thanks again!

@wouterj wouterj closed this Jul 2, 2016
wouterj added a commit that referenced this pull request Jul 4, 2016
…WouterJ)

This PR was merged into the 2.7 branch.

Discussion
----------

Update "How to Authenticate Users with API Keys"

Finishes #6157

Original PR description:

 > * `supportsToken` should be defined above `authenticateToken` to reflect documentation numbering
 > * `onAuthenticationFailure` should return http code 401 Unauthorized (RFC 7235) not 403 Forbidden.
 > * added missing information about defining `access_control` - figuring this out kept me hanging for a while
 > * used `ROLE_API` instead of `ROLE_USER` to demonstrate `access_control` configuration

Commits
-------

f008819 Use a more realistic /api instead of /admin
81dd5e7 removed message from BadCredentialsException
dbd8bb9 fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants