GithubHelp home page GithubHelp logo

mcdeck / netlify-cms-oauth-provider-php Goto Github PK

View Code? Open in Web Editor NEW
10.0 10.0 1.0 57 KB

Oauth provider for Netlify CMS.

License: MIT License

Shell 10.90% PHP 77.26% Twig 11.84%
github gitlab netlify-cms oauth2 php

netlify-cms-oauth-provider-php's Introduction

Hi there ๐Ÿ‘‹

  • ๐Ÿ”ญ Iโ€™m currently working on ...
    • Super secret projects
  • ๐ŸŒฑ Iโ€™m currently learning ...
    • React
    • Dutch
  • ๐Ÿ‘ฏ Iโ€™m looking to collaborate on ...
    • anything around smarthome, machine learning, data science
    • or any other cool project you may have
  • ๐Ÿ’ฌ Ask me about ...
    • Python
    • Django
    • MQTT
    • Jenkins
    • CI/CD
    • Smarthome
  • ๐Ÿ“ซ How to reach me: ...

netlify-cms-oauth-provider-php's People

Contributors

mcdeck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

gabonidev

netlify-cms-oauth-provider-php's Issues

Use with multiple projects?

It appears to me that origin has to be defined and it would be the url of the cms project?
Would it be possible to pass in origin in the request from the cms so that this auth provider could be used for multiple different projects?

Or am I doing it/thinking about it wrong?

PS: I see that gitlab has a strikethrough in your readme, I just tested this with my own gitlab server and it works perfectly :)

origin parameter is too restrictive

When settings origin to e.g. https://www.-van-porten.de but going to https://van-porten.de/admin (without the www) and then trying to log in via GitHub it does not work with the following error that is only visible on the console:
auth.van-porten.de/callback?code=186c9d03baac1e947fae&state=1e0141270b46d029bc38dc71792141adafc1565ef990ab43a78776228a3a170debcf4f992c805c58a18e7d8e14e2524858f530450c810aafc6f89ae4239717da:9 Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://www.van-porten.de') does not match the recipient window's origin ('https://van-porten.de').

Either there should be a proper error message visible to the user or better yet, it should be possible to use a wildcard origin. In the original Javascript code there was some check for a wildcard, see https://github.com/vencax/netlify-cms-github-oauth-provider/blob/bad35f2972691acdfb6397377aa656afc4f0b148/callback.js#L42
But I wonder if that would actually work in this scenario here...

Attempted to call function "putenv" from namespace "Symfony\Component\HttpKernel"

Hello,
I am trying to implement this oauth to my application, but I have an error with Symfony and I have no idea where the problem is. Error message looks like this:
image

my .env.local looks like this:

OAUTH_CLIENT_ID=xxxxx OAUTH_CLIENT_SECRET=xxx REDIRECT_URI=http://auth.ondrejstarek.site/callback ORIGIN=http://ondrejstarek.site
I have also this in my .env file.

I am quite confused and without any clue of whats wrong. Thank you for any help!

Fail to Login

First, Thank you for developing this and sharing it.

I have a problem completing the authorization after following the steps mentioned in the readme.

I get this error on the main window:

Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('<URL>') does not match the recipient window's origin ('<URL>').


โ€‹ Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://cms.example.com') does not match the recipient window's origin ('https://www.example.com').

The subdomain https://cms.example.com is where I serve this netlify-cms-oauth-provider-php.

Here's what I have done:

config.yml:

backend:
  name: gitlab 
  branch: BranchName 
  repo: user/RepoName
  base_url: http://cms.example.com/

.env for netlify-cms-oauth-provider-php.

APP_ENV=prod
APP_SECRET=asdasdasczxc12235
OAUTH_PROVIDER=gitlab
SCOPES=api
OAUTH_DOMAIN=https://gitlab.com
OAUTH_CLIENT_ID=asdasdasdxcasd123
OAUTH_CLIENT_SECRET=asdasdasdxcasd123
REDIRECT_URI=https://cms.example.com/callback/
ORIGIN=example.com

Gitlab app:

Callback URL =
https://cms.example.com/callback/
https://cms.example.com/callback

Confidential = No
Scopes = api (Access the authenticated user's API)

Steps to reproduce:

  1. Enter https://www.example.com/admin
  2. Click on "Login with Gitlab"
  3. Popup window opens and is sent to: https://gitlab.com/users/sign_in
  4. Login with Gitlab credentials
  5. Popup window is redirected to: https://cms.example.com/callback?code=asdfasdfasdf1234&state=123123asdasdazxca
  6. Check the console in the main window and find the error:
Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('<URL>') does not match the recipient window's origin ('<URL>').


โ€‹ Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://cms.example.com') does not match the recipient window's origin ('https://www.example.com').

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.