lowcoder-org / lowcoder

🔥 🔥 🔥 The Open Source Retool, Tooljet and Appsmith Alternative
https://www.lowcoder.cloud/
GNU Affero General Public License v3.0
688 stars 153 forks source link

[Bug]: User Authentication Provider loses values when trying to edit it in the form #948

Closed martkaczmarek closed 5 days ago

martkaczmarek commented 1 month ago

Is there an existing issue for this?

Current Behavior

After creating a new User Authentication Provider (which works and is functional) and going into edit of the entry, a few fields are empty. Before: image

After saving and going into edit again: image

Authentication Provider still works if we fill these fields again, it just shows empty fields in the edit form.

Expected Behavior

Authentication Provider edit form should correctly pull and display saved data.

Steps to reproduce

  1. Create a new User Authentication Provider and save it
  2. Go to /setting/oauth-provider and try to edit the new entry

Environment

Docker Compose multi-image Lowcoder version: 2.4.0

Additional Information

No response

FalkWolsky commented 1 month ago

We are on it...

martkaczmarek commented 1 month ago

Update on 2.4.1: providers newly created under 2.4.1 work correctly and don't "lose" the values. However, entry created earlier under 2.4.0 shows empty white page when clicking on entry and refuses to show. Here is the https://app/api/auth/configs result:

{
    "code": 1,
    "message": "",
    "data": [
        {
            "id": "512ee9d0f2e44cdabc85970496669184",
            "source": "Entra",
            "sourceName": "Entra",
            "enable": true,
            "enableRegister": true,
            "authType": "GENERIC",
            "clientId": "xxxxxxxxxxxxxxxxxxxx",
            "clientSecret": "xxxxxxxxxxxxxxxxxxxx",
            "sourceDescription": "This is the entry created under 2.4.0",
            "sourceIcon": "/icon:antd/windowsfilled",
            "sourceCategory": "Source Description",
            "issuerUri": null,
            "authorizationEndpoint": "https://login.microsoftonline.com/xxxxxxxxxxxxxxxxxxxx/oauth2/v2.0/authorize",
            "tokenEndpoint": "https://login.microsoftonline.com/xxxxxxxxxxxxxxxxxxxx/oauth2/v2.0/token",
            "userInfoEndpoint": "https://graph.microsoft.com/oidc/userinfo",
            "scope": "openid profile email offline_access",
            "sourceMappings": null,
            "userInfoIntrospection": true
        },
        {
            "id": "312af4afb1f04060a1bee5ff7cf5ad6e",
            "source": "test",
            "sourceName": "test",
            "enable": true,
            "enableRegister": true,
            "authType": "GENERIC",
            "clientId": "xxxxxxxxxxxxxxxxxxxx",
            "clientSecret": "sdfsdfsdf",
            "sourceDescription": "This is the entry created under 2.4.1",
            "sourceIcon": "/icon:regular/address-book",
            "sourceCategory": "ENTERPISE_ENTITY",
            "issuerUri": "https://login.microsoftonline.com/xxxxxxxxxxxxxxxxxxxx/oauth2/v2.0/token",
            "authorizationEndpoint": "https://login.microsoftonline.com/xxxxxxxxxxxxxxxxxxxx/oauth2/v2.0/authorize",
            "tokenEndpoint": "https://login.microsoftonline.com/xxxxxxxxxxxxxxxxxxxx/oauth2/v2.0/token",
            "userInfoEndpoint": "https://graph.microsoft.com/oidc/userinfo",
            "scope": "sdf sdfsdf",
            "sourceMappings": {
                "uid": "a",
                "avatar": "b",
                "email": "c",
                "username": "d"
            },
            "userInfoIntrospection": false
        },
        {
            "id": "EMAIL",
            "enable": true,
            "enableRegister": false,
            "source": "EMAIL",
            "sourceName": "EMAIL",
            "authType": "FORM"
        }
    ],
    "success": true
}

Oh, and that also prevents us from removing or disabling the faulty old one.

FalkWolsky commented 5 days ago

We currently have the functionality to remove Auth Providers only through the API. Please excuse. Generally, we think to close the Issue for now. If we are wrong and there is still an important issue left (bug), just please re-open