Commit Graph

17 Commits

Author SHA1 Message Date
Alan Guo Xiang Tan 3e3c2ae44d
DEV: Skip test that is resetting state of other plugins. (#48)
Follow-up to d1a912ebc8
2021-07-02 16:16:03 +08:00
Roman Rizzi d1a912ebc8
FEATURE: Fetch custom attributes from the user details. (#47)
Other plugins can tell the authenticator to traverse the user details JSON using custom paths and store the values in the user associated account extra field.
2021-07-01 18:23:27 -03:00
David Taylor f45cd3edf9
FEATURE: Handle invalid email_verified data from identity provider (#40)
Some identity providers send email_verfied as a 'true'/'false' string, not a boolean. (e.g. this bug in Auth0: https://community.auth0.com/t/27553)

This commit adds automatic handling for this case, so that the string is automatically converted into a real boolean.
2021-04-21 11:16:25 +01:00
David Taylor 96a0bde0aa
FEATURE: Allow JSON paths with literal dots in the keys (#33)
This is achieved by surrounding a key with double quotes, or by escaping
the dot character with a backslash.

For example, given the JSON

```
{ "www.example.com/uid": "myuid" }
```

Previously, there was no way to access this value. The dots would make
the parser try to access `json["www"]["example"]["com/uid"]`.

Now, this value can be accessed by using a `oauth2_json_user_id_path` like:

```
www\.example\.com/uid
```
or alternatively:
```
"www.example.com/uid"
```
2021-03-10 11:48:58 +00:00
Josh Kerxhalli-Kleinfield ca5f555750
FEATURE: Allow using array indexes in json paths (#22) 2020-04-21 14:46:42 +01:00
David Taylor 47a8211d9a
DEV: Correct OAuth2BasicAuthenticator namespace, remove spec workarounds 2020-04-14 21:32:35 +01:00
Penar Musaraj e49eb3bd9f Make Rubocop happy 2019-07-29 21:32:27 -04:00
Angus McLeod 5ae9f35e81 FEATURE: Migrate to ManagedAuthenticator (#21)
This brings the plugin in-line with recent core improvements. Advantages include

- Account-linking logic and storage is shared between all authentication providers
- Optionally, users can be allowed to disconnect/reconnect their accounts
- The 'last used' date of an association is recorded
- Association metadata is recorded in the database for use in data explorer and other plugins

Data migration will be performed automatically, and all existing functionality is maintained.
2019-07-27 16:34:17 +01:00
Angus McLeod eb31cdf44f Handle fetch user details failure (#20)
* handle failure in get_user_details request

* add spec

* improve spec

* return nil on failure
2019-07-11 10:31:51 -04:00
Angus McLeod a634ff896d Use token callback user details (#18)
* Add way to use user details returned in token response

* Add spec

* Apply suggestions from code review

Co-Authored-By: Robin Ward <robin.ward@gmail.com>
2019-07-05 10:27:07 -04:00
Angus McLeod ef5b3ee1ff FEATURE: Allow provider to set email verification state (#17) 2019-06-26 11:03:52 +01:00
Guo Xiang Tan 5a459fbb6e Add frozen string literal comment to files. 2019-05-13 10:49:26 +08:00
David Taylor 722fe23b4e FEATURE: Add site setting to override user email address during login 2019-03-26 20:38:46 +00:00
David Taylor 090f63c429 FIX: Download avatar for new users
Previously avatars were only loaded on subsequent logins
2019-02-05 14:53:34 +00:00
misaka4e21 f603604caa
FEATURE: Support avatar retrieval. 2018-05-25 14:34:50 +08:00
Blake Erickson bce6e9e878 ADD: can now walk json that contains arrays
I feel like this is kind of a hack to handle a change with Auth0 where
the actual user id is inside of an array of identities. While I do think
it would be good to build an actual plugin for Auth0 to better handle
their use case I do feel that it is important that we can handle Auth0
with this plugin for now.
2018-05-16 14:53:10 -06:00
Leo McArdle f0151cdea6 add spec 2017-09-06 23:15:10 +01:00