无法启用插件,因为它引起了一个致命错误(fatal error)
Warning: require(/www/wwwroot/.com/wp-content/plugins/flarum-sso/config.php): failed to open stream: No such file or directory in /www/wwwroot/.com/wp-content/plugins/flarum-sso/Forum.php on line 11

Fatal error: require(): Failed opening required '/www/wwwroot/.com/wp-content/plugins/flarum-sso/config.php' (include_path='.:/www/server/php/70/lib/php') in /www/wwwroot/.com/wp-content/plugins/flarum-sso/Forum.php on line 11

    I have problem :

    Warning: require(/home/web12638/web/wp-content/plugins/sample-website/config.php): failed to open stream: No such file or directory in /home/web12638/web/wp-content/plugins/sample-website/Forum.php on line 11

    DoubleWorld Your problem is the missing config.php. This is not well documented but you should copy the config.php.dist to config.php and change the settings according to your needs. After that everything should work fine.

    Great extension! Keep up the good work!

    Some notes from my end as of beta7 + ext-sso July 9th release:

    • You can disable signup in admin panel in the permissions tab.

    • With this extension enabled, any user registered will automatically be activated.

    • Fresh Flarum beta7 install => go to http://your.flarum.site/ and configure admin/MySQL => install extension with composer require => go to admin panel and enable the extension => admin panel crashed

      Fresh Flarum beta7 install => install extension with composer require => go to http://your.flarum.site/ and configure admin/MySQL => go to admin panel => bravo! extension setting page pops up, the extension is automatically enabled and everything works as expected

    Feature request/Future work/My demands or whatever

    • My existing user system has an avatar system and I want to use that directly. I'm not sure whether it should be part of this extension, but since it's related to sso I'll just put it here:

      • Supply url as avatar src to Flarum. As of beta7 Flarum only accept url at register time and it will download and cache the avatar. After that, updating the url or re-caching is not possible without hacking into core files.

        Directly using url is also not possible.

      • Disable avatar upload/delete. This is trivial in the front end. It can be done by overriding the AvatarEditor model. I don't know this should be in a separate extension or bundled with this sso extension, since disabling avatar upload without sso doesn't make sense anyway. I'm working on it right now so I'd like to see what do you think @wuethrich

        However, the API will still be opened and operational. This means that users can still upload/delete with API and break the sso setting. Is there any way to disable this or set permission to prevent users from modifying the avatar?

    • In sample-website, add an API path option. Currently flarum_url is used for both redirection and API requests. As SSO is normally implemented with multiple machines talking to each other over some kind of private network, it makes more sense that such API requests bypass reverse proxy/load balancer and go directly to the Flarum server. For example: "flarum_url" => "myFlarum.foo.bar", "api_url" => "localhost:8080", and use api_url in sendPostRequest method. I'll submit a pull request on GitHub unless you think this is overdone to be added to sample-website. (It's just a sample-website, but Forum.php and config.php act more like a tiny library tho)

      zinsser Fresh Flarum beta7 install => go to http://your.flarum.site/ and configure admin/MySQL => install extension with composer require => go to admin panel and enable the extension => admin panel crashed

      I've just tested the extension with beta7 and I hadn't this issue. Could you provide a error message or something to track this problem down?

      zinsser My existing user system has an avatar system and I want to use that directly.

      I don't use an avatar system in my setup so I won't develop anything in this direction. However, it sounds like a nice feature so I would be very happy if you provide a PR.

      zinsser add an API path option

      I would like to keep the sample-website as simple as possible so I don't think we should include this in the extension. If someone really need this it is added quickly.

      a month later

      Here are two problem.
      1.When i only logout at wordpress, flarum still logged on.
      2.When i logout at flarum, url will redirect to "flarum_url/logout?token=xxx" first, and then redirect to "/wp-login.php?action=logout", at the page of wordpress, if i refuse to logout, the flarum have been logout.

        7 days later

        Hey @wuethrich and the rest! Congrats on the awesome extension! I've been reading this discussion and would like to get a few clarifications. We have a WordPress community where users can create accounts and Flarum installed on a subdomain.

        My question is:

        If we install this extension and WP plugin on our main site does it mean our existing forum users won't be able to sign in (because they already exist in Flarum's database)?

          pgshow Yes this sucks but I can't do anything about that because that's how the Wordpress logout works. But if you are coming up with an idea let me know...

          DKornyukhov Existing Flarum users can't login with Wordpress because the account already exists and I cannot set a password. You could write some custom logic which overrides the current password but it doesn't work out of the box.

            wuethrich Ah, that's a bummer! I guess, I'll have to stick to the old way of doing things, - by giving new users instructions to create separate forum account. It's not ideal, but I hope it'll change in the future. Thanks for replying! Really appreciate it @wuethrich! ?

            @wuethrich Thank you for your contribution ?

            @DKornyukhov You can also have a look at this extension.

            I have not tested this theory with your current issue, but, you can try to have your users use the same password for Wordpress and Flarum (This should do the trick).

              5 days later

              Thanks for the extension. I'm now working on integrating Flarum with my existing app.

              One thing that I don't understand, is why this extension activates users as they register.
              Could this be added as a checkbox, perhaps? So people can decide whether users get activated?

              I've got my own user system with own activation algorithm and I'd like to manually activate them when user confirms their e-mail address.

                ikonrad Usually your existing app takes care of activating a user. So if a user can successfully login through your existing app he is automatically enabled in the forum because his email is already confirmed.

                  wuethrich Thanks for the reply!
                  On flarum, you can still log in without being activated (which is the case in my application as well) so I'm not sure where the assumption that being able to log in = user confirmed comes from.

                    ikonrad Sorry but I don't understand your exact use case but you can provide a PR to make activating users configurable and I will publish a new version.

                    2 months later

                    Hi
                    There have a problem . When I use composer install Single Sign On , my service tell my some thing wrong
                    like this

                    Your requirements could not be resolved to an installable set of packages.
                    
                      Problem 1
                        - wuethrich44/flarum-ext-sso v1.1.1 requires flarum/core ^0.1.0-beta.6 -> satisfiable by flarum/core[0.1.x-dev, v0.1.0-beta.6, v0.1.0-beta.7] but these conflict with your requirements or minimum-stability.
                        - wuethrich44/flarum-ext-sso v1.1.0 requires flarum/core ^0.1.0-beta.6 -> satisfiable by flarum/core[0.1.x-dev, v0.1.0-beta.6, v0.1.0-beta.7] but these conflict with your requirements or minimum-stability.
                        - Installation request for wuethrich44/flarum-ext-sso ^1.1 -> satisfiable by wuethrich44/flarum-ext-sso[v1.1.0, v1.1.1].
                    Installation failed, deleting ./composer.json.

                      I did what you said, but my Flarum did not respond. Can you tell me how to debug this program?