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

Netlify CMS - Setup Plumbing and Deploy the initial implementation to staging #470

Closed
piers-sinclair opened this issue Apr 15, 2021 · 9 comments

Comments

@piers-sinclair
Copy link
Contributor

piers-sinclair commented Apr 15, 2021

Currently, Netlify CMS works locally but not in staging.

  1. Setup the plumbing so that routing works in staging and resolve anyother issues with deploying to staging.

AB#61096

@piers-sinclair piers-sinclair changed the title Netlify CMS - Setup Plumbing and Deploy the initial mvp to staging Netlify CMS - Setup Plumbing and Deploy the initial implementation to staging Apr 15, 2021
@piers-sinclair
Copy link
Contributor Author

piers-sinclair commented Apr 26, 2021

@bradystroud @wicksipedia @nvhoanganh
As per my research it looks like in order for GitHub authentication to work, we will need to setup our own OAuth Server. @nvhoanganh is this a good place for us to implement IdentityServer to handle this OAuth flow?

The other options include using Azure Active Directory, hosting the site via Netlify or creating our own server similar to this repo or the other ones listed on the Netlify site here.

My perspective is that either Azure Active Directory or IdentityServer looks like the way we should handle this. I assume we would host the IdentityServer instance on Azure.

Let me know your thoughts.

-Piers

@piers-sinclair
Copy link
Contributor Author

piers-sinclair commented Apr 26, 2021

As per my conversation with @nvhoanganh, IDS4 is overkill here since we only want to connect to a GitHub account. Instead we will implement our own client similar to those on the Netlify documentation at https://www.netlifycms.org/docs/external-oauth-clients/ . We should be able to do this using Azure functions because one of the existing clients is a Node.js Azure function and is using Gatsby.

@piers-sinclair
Copy link
Contributor Author

piers-sinclair commented Apr 27, 2021

@kikibianc
As per my conversation with @bradystroud , there is an existing oauth backend and github app registration using Auth0. We will use this to handle the authentication.

First, we need to get Christian to transfer the app from his account to Brady's account (at which point we will transfer it to the SSW-Dash service account).

@bradystroud
Copy link
Member

bradystroud commented May 27, 2021

As per my conversation with @pierssinclairssw, our exisiting OAuth backend is not compatible with NetlifyCMS.

https://tylergaw.com/blog/netlify-cms-custom-oath-provider/
This blog says to use a GitHub backend with NetlifyCMS, you have to have your own server to handle OAuth.

The blog also has an example implementation made with Node.JS which I copied and tested. It solved our problem, but to be consistent with the rest of SSW.Rules, we decided it would be better to rewrite it as C# Azure Functions.
https://github.com/SSWConsulting/SSW.Rules.Functions/tree/61096-netlify-auth/Functions/Functions/AuthCMS

I am having a problem with the callback function where the script in the response is not working.
I copied the script from the blog https://github.com/vencax/netlify-cms-github-oauth-provider/blob/master/callback.js

I also tried similar scripts from the list of other external OAuth clients https://www.netlifycms.org/docs/external-oauth-clients/ but these also did not work

  1. Continue to investigate why the script isn't working

@bradystroud
Copy link
Member

bradystroud commented Jun 7, 2021

cc: @pierssinclairssw

  1. Continue to investigate why the script isn't working

Done - The issue was with the base URL in the config.yml file. see decaporg/decap-cms#1285 (comment) for more info

I fixed that issue but have ran into another problem. When I try deploy the Azure Functions, this error occurs Azure/arm-deploy#48 (same issue Azure/azure-cli#18360)
Since this is an issue with the latest version of the Azure CLI, we might be able to force our action to use an older release.

@bradystroud
Copy link
Member

cc: @pierssinclairssw

Since this is an issue with the latest version of the Azure CLI, we might be able to force our action to use an older release.

This isn't possible as this action https://github.com/Azure/arm-deploy uses the Azure CLI so we can't specify what version we want

@bradystroud
Copy link
Member

bradystroud commented Jun 8, 2021

cc: @pierssinclairssw
The issue with deploying the arm template has been temporarily fixed. See Azure/arm-deploy#48 (comment)

  1. Setup the plumbing so that routing works in staging and resolve anyother issues with deploying to staging.

Done - Netlify is working on staging. 🙂

@bradystroud
Copy link
Member

Reopening as to get it working on staging we need to create a prod OAuth app.

  1. Create a production OAuth application so the authentication functions can be deployed

@bradystroud bradystroud reopened this Jun 8, 2021
@bradystroud
Copy link
Member

cc: @pierssinclairssw

  1. Create a production OAuth application so the authentication functions can be deployed

Done - The azure functions are ready to be deployed

Netlify CMS is working in staging but hasn't been deployed yet

Thanks,

-Brady

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

No branches or pull requests

2 participants