l3mpire / lemverse

The first-ever coworking metaverse
https://app.lemverse.com
GNU Affero General Public License v3.0
148 stars 40 forks source link

How to activate the custom oauth login button? #204

Closed thomasfaure closed 1 year ago

thomasfaure commented 1 year ago

Hello, I configured the settings.json with a custom authentication button, but it has no effect. How to activate this configuration?

ramnes commented 1 year ago

It has been implemented in #46 and #47, so it might be worth summoning @alizarion – can you help?

alizarion commented 1 year ago

hi @thomasfaure, which lemverse release are you using? I just tested with the latest on docker hub and it seems to work can you give us more details? does the buttons appear on the login section? Capture d’écran 2022-11-14 à 13 20 44

thomasfaure commented 1 year ago

hello @alizarion I deployed the master version (1b11733ba888b5905b724241ff6a73c3f104a2bb), but I don't see the custom buttons which are well configured in the settings file : /etc/default/lemverse

alizarion commented 1 year ago

can you share your configuration? buttons can be hidden can you try to add "hidden": false

thomasfaure commented 1 year ago

Yes, here is an extract of the configuration:

"packages": {
      "service-configuration": {
        "custom": {
          "buttonBackgroundColor": "#ea4335",
          "buttonTextColor": "white",
          "clientId": "lemverse",
          "type": "oauth",
          "custom": true,
          "hidden": false,
          "secret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
          "authUrl": "https://my.whaller.com/oauth2/authorize",
          "accessTokenUrl": "https://my.whaller.com/api/oauth2/access_token",
          "identityUrl": "https://my.whaller.com/api/person/me",
          "serverURL": "https://xxxxxx.whaller.com",
          "responseType": "code",
          "loginStyle": "redirect",
          "scope": "openid",
          "identity": ["sname", "fname"]
        },
        "twitter": {
          "consumerKey": "xxxxxxx",
          "secret": "xxxxxxx",
          "type": "oauth",
          "custom": false,
          "loginStyle": "redirect"
        },
        "github": {
          "clientId": "xxxxxxx",
          "buttonBackgroundColor": "#5880ff",
          "buttonTextColor": "white",
          "type": "oauth",
          "custom": false,
          "secret": "xxxxxxx"
        },
        "google": {
          "clientId": "xxxxxxx",
          "buttonBackgroundColor": "#5880ff",
          "buttonTextColor": "white",
          "type": "oauth",
          "custom": false,
          "secret": "xxxxxxx",
          "loginStyle": "redirect"
        },
        "facebook": {
          "appId": "xxxxxxx",
          "buttonBackgroundColor": "#5880ff",
          "buttonTextColor": "white",
          "type": "oauth",
          "custom": false,
          "secret": "xxxxxxx",
          "loginStyle": "redirect"
        }
      },

as you can see,

I simply modified the "custom" configuration and did not touch the twitter, github, etc configurations that I do not need

alizarion commented 1 year ago

@thomasfaure sorry for late answer, it's your own build or official lemverse docker image ? i think your configuration file or env is not parsed correctly ... can you try this in chrome console

  ServiceConfiguration.configurations.find()
          .observe({
              added(record) {
                  console.log(record);

              },
          });
thomasfaure commented 1 year ago

@alizarion

Here is the screenshot of the answer, I don't know if it can help.

image

alizarion commented 1 year ago

@thomasfaure I think the second line of the query is ignored because of the copy paste :) you should see something like this Capture d’écran 2022-11-21 à 11 28 08

alizarion commented 1 year ago

if no records it means your configuration is ignored

thomasfaure commented 1 year ago

yes, which makes sense since I don't see a custom button.

Do you know why it is ignored?

Two things:

the "packages" scope is not in "public" :

image

and the "packages" scope is inside a "peer" scope:

image

thomasfaure commented 1 year ago

@alizarion it's better now :)

image