Commit graph

38 commits

Author SHA1 Message Date
Antonio
c9d12076ce
Actually use 'trusted_audiences' in oauth2 strategy. (#770) 2024-08-15 17:30:17 -04:00
81236e1ed5
fix: correctly generate sign-in tokens when requested. 2024-06-06 14:34:30 +12:00
4e66a402fe
improvement: Only require tokens to be enabled when using a strategy which needs them. 2024-05-10 14:38:09 +12:00
Zach Daniel
8070e011cd chore: add ash-functions for tests 2024-04-25 22:29:17 -04:00
Martin Schut
8721c01b4c
improvement(OIDC): Adjust dsl of OIDC reflect assent requirements (#538)
The OIDC implementation of assent requires the base_url to be set and ignores the different *_url attributes. At favours the returned configuration from the openid_configuration_uri. To not configure some unused attributes they're removed.
2024-04-12 09:22:58 +12:00
de9ef14b2e
improvement: re-integrate ash_graphql and ash_json_api RCs. 2024-04-02 09:23:30 +13:00
f0075e2cd3
improvement!: Update to support Ash 3.0. (#599) 2024-03-28 14:44:23 +13:00
dependabot[bot]
408a28ccf4
chore(deps): Bump assent from 0.2.7 to 0.2.8 (#506)
* chore(deps): Bump assent from 0.2.7 to 0.2.8

Bumps [assent](https://github.com/pow-auth/assent) from 0.2.7 to 0.2.8.
- [Release notes](https://github.com/pow-auth/assent/releases)
- [Changelog](https://github.com/pow-auth/assent/blob/main/CHANGELOG.md)
- [Commits](https://github.com/pow-auth/assent/compare/v0.2.7...v0.2.8)

---
updated-dependencies:
- dependency-name: assent
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore(OAuth2): Reflect `assent` `site` -> `base_url` change.

I considered just rewriting it behind the scenes, but I think it's probably better in the long run if we just emit a deprecation.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: James Harton <james@harton.nz>
2023-11-22 10:49:07 +13:00
Zach Daniel
575785c3f2
docs: remove registries from docs and examples (#388) 2023-08-16 19:58:48 +12:00
Zach Daniel
dd622d769d chore: update ash_graphql, remove deprecated function 2023-06-12 23:08:00 -04:00
James Harton
53ff256391
feat: OpenID Connect Strategy (#197)
* feat(AshAuthentication.Strategy.Oidc): Add OpenID Connect strategy.

* chore(CI): disable the workflow on pull request event, since it's covered by push.
2023-05-04 13:15:24 +12:00
Zach Daniel
eca8cadea0
improvement: add sign in tokens to password strategy (#252)
* improvement: add sign in tokens to password strategy

* chore: update `.formatter.exs`.

* chore: fix credo warnings.

* improvement: convert `sign_in_with_token` into an action.

---------

Co-authored-by: James Harton <james@harton.nz>
2023-04-06 14:53:44 +12:00
Zach Daniel
7f1c9678e4
feat!: Configure accepted fields on register (#219) 2023-03-04 01:44:34 -05:00
Hannes Wüthrich
65e848c5e0
fix: sign in preparation without identity resource (#198) 2023-02-20 10:02:04 +13:00
Zach Daniel
a2bba519c0
improvement: add select_for_senders (#189)
* improvement: add select_for_senders
fix: select `hashed_password` on sign in preparation

* improvement: include metadata declaration on register action

* chore: fix typo
2023-02-12 21:15:23 +13:00
James Harton
ca3dac3878
fix: don't allow special purpose tokens to be used for sign in. (#191)
This fixes a security issue where someone in possession of a special purpose token (reset, confirmation, magic link, etc) would be able to access an API using this token.  We strongly encourage you to upgrade.

Closes #190.
2023-02-12 21:14:16 +13:00
James Harton
cf3d227ef2
feat: Add new "magic link" authentication strategy. (#184) 2023-02-09 21:05:49 +13:00
James Harton
3bece5f657
improvement(Strategy.Custom): handle custom strategies as extensions. (#183)
This means that users can add their own extensions to their resources which patch the strategy (and add ons) DSLs.
2023-02-08 16:10:28 +13:00
James Harton
7e639e4a21
feat: Add support and documentation for custom strategies. (#154) 2023-01-30 13:16:37 +13:00
James Harton
085d640c44
fix(Confirmation): send the original changeset to confirmation senders. (#132)
Changes the behaviour of the `ConfirmationHookChange` to pass the original, unmodified changeset in the sender options so that senders can account for inhibited changes.
2023-01-13 13:30:58 +13:00
James Harton
4129aa969a
feat(GitHub)!: Add GitHub authentication strategy. (#125) 2023-01-12 17:23:40 +13:00
James Harton
d5c5d6b6c5
feat: Add token-required-for-authentication feature. (#116)
* Adds the `require_token_presence_for_authentication?` DSL option to the Authentication extension which when enabled changes the following behaviour:
  1. The `store_in_session` plug will store the user's token rather than their subject in the session.
  2. The `retrieve_from_session` plug will look for a stored token in the session rather than a subject and ensure that it's present in the `TokenResource`.
  3. The `retrieve_from_bearer` plug will ensure that the token is present in the `TokenResource`.
* Adds the `get_token` action to the `TokenResource`.
2023-01-11 15:12:53 +13:00
James Harton
792ec056b8
feat: Make strategy names optional where possible. (#113) 2023-01-09 15:02:48 +13:00
James Harton
5ba5e163f3
improvement: Allow the strategy name to be passed for password validations and changes. (#102)
After #89 was merged folks were no longer able to use `AshAuthentication.Strategy.Password.HashPasswordChange` and `AshAuthentication.Strategy.Password.PasswordConfirmationValidation` in their own actions.  This change fixes this issue by allowing the name of the strategy to be passed in in the changeset context.
2023-01-09 09:27:50 +13:00
James Harton
cf9ad01dd5
feat(Auth0): Add a pre-configured Auth0 strategy. (#99) 2022-12-16 13:06:51 +13:00
James Harton
f1cd72407a
feat: Add option to store all tokens when they're created. (#91) 2022-12-14 15:06:13 +13:00
James Harton
6dfbf03f11
improvement: remove the need for a strategy in changeset/query contexts. (#89)
The action -> strategy mapping is now stored directly in the resource DSL.

Closes #84.
2022-12-13 16:35:30 +13:00
371a6ad821 improvement(Jwt)!: Use token signing secret into the DSL.
Use the `AshAuthentication.Secret` behaviour, rather than asking the user to explicitly set it in their application environment.

This is a breaking change that will require folks to change their resource config to look up the signing secret.

Closes #79.
Closes #77.
2022-12-12 10:45:28 +13:00
776bd8ea6c improvement(TokenResource)!: Move TokenRevocation -> TokenResource.
This paves the way to fix #47.
2022-12-01 08:41:49 +13:00
James Harton
e88a516b22
improvement(Confirmation): Confirmation is not a strategy. (#46)
* improvement(Confirmation): Confirmation is not a strategy.

* improvement(Confirmation): Support more than one confirmation entity.

* chore: move FIXME doc to issue.
2022-11-24 16:40:15 +13:00
James Harton
1c8f138c67
improvement!: Major redesign of DSL and code structure. (#35)
Highlights:

* Replaced `AshAuthentication.Provider` with the much more flexible `AshAuthentication.Strategy`.
* Moved strategies to within the `authentication` DSL using entities and removed excess extensions.
* Added a lot more documentation and test coverage.
2022-11-23 09:09:41 +13:00
James Harton
65d53e3597 improvement(OAuth2Authentication)!: Make the site option runtime configurable. (#31) 2022-11-15 14:46:42 +13:00
James Harton
c5f589058e
feat(OAuth2Authentication): Add support for generic OAuth2 endpoints. (#28) 2022-11-10 14:47:06 +13:00
James Harton
1d4bb00617
feat(Confirmation): Add extension that allows a user to be confirmed when created or updated. (#27) 2022-11-04 21:05:47 +13:00
James Harton
bab9ec363e
fix(PasswordReset): Generate the reset token using the target action, not the source action. (#25)
* fix(PasswordReset): Generate the reset token using the target action, not the source action.

Also improve tests.

* improvement(PasswordReset): rework PasswordReset to be a provider in it's own right - this means it has it's own routes, etc.
2022-11-04 11:24:33 +13:00
James Harton
0eca3274f0
feat(PasswordReset): allow users to request and reset their password. (#22) 2022-11-02 18:18:20 +13:00
James Harton
8797005175
feat(Ash.PlugHelpers): Support standard actor configuration. (#16)
* improvement(docs): change all references to `actor` to `user`.

The word "actor" has special meaning in the Ash ecosystem.

* chore: format `dev` directory also.

* feat(Ash.PlugHelpers): Support standard actor configuration.

* Adds the `:set_actor` plug which will set the actor to a resource based on the subject name.
* Also includes GraphQL and JSON:API interfaces in the devserver for testing.
2022-10-31 16:43:00 +13:00
James Harton
a939dde9b9
feat(PasswordAuthentication): Registration and authentication with local credentials (#4)
This is missing a bunch of features that you probably want to use (eg confirmation, password resets), but it's a pretty good place to put a stake in the sand and say it works.
2022-10-25 11:07:07 +13:00