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

allow custom auth endpoint #1294

Merged
merged 1 commit into from
Apr 25, 2018
Merged

allow custom auth endpoint #1294

merged 1 commit into from
Apr 25, 2018

Conversation

erquhart
Copy link
Contributor

@erquhart erquhart commented Apr 20, 2018

- Summary

Currently the path "/auth" is enforced for authentication, even with a custom base_url. Developers should be able to override the default endpoint.

Fixes #1285.

- Description for the changelog

allow custom auth endpoint

@verythorough
Copy link
Contributor

Deploy preview for cms-demo ready!

Built with commit 55ff84f

https://deploy-preview-1294--cms-demo.netlify.com

@verythorough
Copy link
Contributor

Deploy preview for netlify-cms-www ready!

Built with commit 55ff84f

https://deploy-preview-1294--netlify-cms-www.netlify.com

@verythorough
Copy link
Contributor

Deploy preview for netlify-cms-www ready!

Built with commit cfb2907

https://deploy-preview-1294--netlify-cms-www.netlify.com

@verythorough
Copy link
Contributor

Deploy preview for cms-demo ready!

Built with commit cfb2907

https://deploy-preview-1294--cms-demo.netlify.com

@verythorough
Copy link
Contributor

Deploy preview for netlify-cms-www ready!

Built with commit 8cc6bb3

https://deploy-preview-1294--netlify-cms-www.netlify.com

@verythorough
Copy link
Contributor

Deploy preview for cms-demo ready!

Built with commit 8cc6bb3

https://deploy-preview-1294--cms-demo.netlify.com

@verythorough
Copy link
Contributor

verythorough commented Apr 20, 2018

Deploy preview for netlify-cms-www ready!

Built with commit fbe49b0

https://deploy-preview-1294--netlify-cms-www.netlify.com

@verythorough
Copy link
Contributor

verythorough commented Apr 20, 2018

Deploy preview for cms-demo ready!

Built with commit fbe49b0

https://deploy-preview-1294--cms-demo.netlify.com

@erquhart
Copy link
Contributor Author

@marksteele please test and confirm this works for your use case.

Copy link
Contributor

@marksteele marksteele left a comment

Choose a reason for hiding this comment

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

I can confirm that the fix addresses my issue.

@tech4him1
Copy link
Contributor

@erquhart I'm good with this. I do wonder, however, if it would just be better to have a new setting like auth_url that would replace the base_url and authEndpoint at once. base_url is already really unclear in my opinion.

@erquhart
Copy link
Contributor Author

I considered that, but base_url is used in a few places. We'd need to make sure it's okay to get rid of.

Sent with GitHawk

@tech4him1
Copy link
Contributor

Hmm, that may be necessary, but I only see it used with netlify-auth.js (and the components that forward the value to it).

@erquhart
Copy link
Contributor Author

erquhart commented Apr 24, 2018

I believe we're using it to test against the origin property of the MessageEvent from the popup, so we need the stripped origin. We could strip it from auth_url internally, though. Just another moving part is all.

I'm inclined to go with what's in this PR since it's backward compatible, and maybe provide the more ideal solution you're describing in a 2.0 PR. What do you think? If you'd really rather us go for it, it's a matter of someone having time.

@tech4him1
Copy link
Contributor

2.0 is fine, go for it.

@@ -84,6 +84,7 @@ class App extends React.Component {
isFetching: auth && auth.get('isFetching'),
siteId: this.props.config.getIn(["backend", "site_domain"]),
base_url: this.props.config.getIn(["backend", "base_url"], null),
authEndpoint: this.props.config.getIn(["backend", "auth_endpoint"]),
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we should make backends get the value themselves, instead of passing them all in here. Maybe a 2.0 thing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

2.0, but yeah that definitely makes sense. @Benaiah what do you think?

@erquhart erquhart merged commit 855bfde into master Apr 25, 2018
@tech4him1 tech4him1 deleted the auth-endpoint branch April 25, 2018 20:59
brianlmacdonald pushed a commit to brianlmacdonald/netlify-cms that referenced this pull request May 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Troubleshooting oauth client
4 participants