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

Add Toyhouse OAuth2 authentication #300

Merged
merged 16 commits into from
Apr 29, 2022

Conversation

corowne
Copy link
Owner

@corowne corowne commented Apr 17, 2022

It's here!! Big thank you to TH admin for getting OAuth2 up and working 🙏💖💕

Go to https://toyhou.se/~developer to set up a client and grab your keys.

This setup was a bit more finicky than the others (code-wise), and there are a few things to note while using it:

  • This can't be tested from localhost (there might be workarounds but it might still be annoying, I set up an instance on my server to test it)
  • When creating a new app, the redirect URL has to be very specifically http://your-site.com/auth/callback/toyhouse as it doesn't seem to use wildcard matching. You may have to enter both non-www and www variants if you use them, etc.

Aside from these, no database/composer updates required. Please add to .env:

TOYHOUSE_CLIENT_ID=
TOYHOUSE_CLIENT_SECRET=

A couple of notes:

  • I wrote a custom Socialite provider, but an official one MIGHT be added eventually so I'll change it then.
  • Unlike the others, this one uses the Socialite driver stateless - received this recommendation for a stubborn error. It seems to work fine but I'm not entirely sure about the implications of this yet.
  • Since TH is widely used within the adoptables community, and with dA sinking like the Titanic, I've opted to make this a primary alias type by default.

On an unrelated note I used the admin account setup to verify/enter an initial deviantART alias, but it still acted like I didn't have an alias attached (redirected me to the link page, and the new alias I authorised got set as a primary alias, so I ended up with 2 primary aliases) so there's probably a bug to look at there.

@corowne corowne requested a review from itinerare April 17, 2022 11:10
@corowne corowne added this to the v2.1.0 milestone Apr 17, 2022
@itinerare itinerare added enhancement New feature or request needs review Pull requests that are pending community review labels Apr 17, 2022
Copy link
Collaborator

@itinerare itinerare left a comment

Choose a reason for hiding this comment

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

Tested and works like a charm!
Noting here that I used all variations of redirect URL (w/ and w/o www, http vs https) in case it makes a difference....

@itinerare itinerare added reviewed Pull requests that have received community review and are pending merge and removed needs review Pull requests that are pending community review labels Apr 29, 2022
@itinerare itinerare merged commit 3638da1 into develop Apr 29, 2022
@itinerare itinerare deleted the feature/add-toyhouse-authentication branch April 29, 2022 23:41
corowne added a commit that referenced this pull request Nov 14, 2022
…events.

---

Merge pull request #300 from corowne/feature/add-toyhouse-authentication

Add Toyhouse OAuth2 authentication
AW0005 pushed a commit to AW0005/lorekeeper-extensions that referenced this pull request Jan 11, 2023
…events.

---

Merge pull request corowne#300 from corowne/feature/add-toyhouse-authentication

Add Toyhouse OAuth2 authentication
itinerare added a commit to itinerare/lorekeeper that referenced this pull request Jun 13, 2023
* Update README.md

* no message

* Prioritised merge of the TH auth feature from develop due to current events.

---

Merge pull request corowne#300 from corowne/feature/add-toyhouse-authentication

Add Toyhouse OAuth2 authentication

* Remove Discord from the sites config

* fix(aliases): backport URL matching fixes from develop

* fix(aliases): backport alias location from develop

* chore(deps): bump loader-utils from 1.2.3 to 1.4.2

Bumps [loader-utils](https://github.com/webpack/loader-utils) from 1.2.3 to 1.4.2.
- [Release notes](https://github.com/webpack/loader-utils/releases)
- [Changelog](https://github.com/webpack/loader-utils/blob/v1.4.2/CHANGELOG.md)
- [Commits](webpack/loader-utils@v1.2.3...v1.4.2)

---
updated-dependencies:
- dependency-name: loader-utils
  dependency-type: indirect
...

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

* Add deviantart's noai and noimageai directives to all pages to (hopefully) prevent scraping for machine learning

* chore(update): 2.1.0

* chore(deps): bump minimatch from 3.0.4 to 3.1.2

Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.0.4 to 3.1.2.
- [Release notes](https://github.com/isaacs/minimatch/releases)
- [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md)
- [Commits](isaacs/minimatch@v3.0.4...v3.1.2)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-type: indirect
...

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

* chore(deps-dev): bump axios from 0.21.1 to 0.21.2

Bumps [axios](https://github.com/axios/axios) from 0.21.1 to 0.21.2.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v0.21.2/CHANGELOG.md)
- [Commits](axios/axios@v0.21.1...v0.21.2)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: direct:development
...

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

* chore(deps): bump decode-uri-component from 0.2.0 to 0.2.2

Bumps [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2.
- [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases)
- [Commits](SamVerschueren/decode-uri-component@v0.2.0...v0.2.2)

---
updated-dependencies:
- dependency-name: decode-uri-component
  dependency-type: indirect
...

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

* chore(deps): bump express from 4.16.4 to 4.18.2

Bumps [express](https://github.com/expressjs/express) from 4.16.4 to 4.18.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](expressjs/express@4.16.4...4.18.2)

---
updated-dependencies:
- dependency-name: express
  dependency-type: indirect
...

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

* chore(deps): bump json5 from 1.0.1 to 1.0.2

Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](json5/json5@v1.0.1...v1.0.2)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

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

* chore(deps): update dependencies/requirements

* chore(deps): update doctrine/dbal

* add back env example

* no message

* i put this in for testing but forgot to take it out oops

* fix err

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: itinerare <ad@itinerare.net>
Co-authored-by: Tan Jie Xin <40315342+corowne@users.noreply.github.com>
Co-authored-by: Tan Jie Xin <perfect.flight@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: itinerare <63693594+itinerare@users.noreply.github.com>
Co-authored-by: jam <ch3rvbcreations@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request reviewed Pull requests that have received community review and are pending merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants