Unable to create SSO connector via REST API (OD-2303)
yehorfedorov opened 10 months ago

Hi everybody! 👋

I'm trying to create SSO connector via REST API by following official API docs but facing issues and can't identify the reason due to empty logs and uninformative HTTP response.

Here is an example:

$ curl -u LOGIN:SUPERPASS -v -X POST [email protected] -H "Content-Type: application/json" http://127.0.0.1:6610/\~api/settings/sso-connectors

The content of req.json file

[
    {
        "@type": "OpenIdConnector",
        "configurationDiscoveryUrl": "https://SOME_URL",
        "clientId": "CLIENT_ID",
        "clientSecret": "CLEINT_SECRET",
        "requestScopes": "openid email profile",
        "groupsClaim": "groups",
        "buttonImageUrl": "/wicket/resource/io.onedev.server.plugin.sso.openid.openidconnector/openid-ver-05FB76CDC6167E1102749BE31F9A3D54.png",
        "name": "onedev",
        "defaultGroup": "admin"
    }
]

The response I'm getting

< HTTP/1.1 400 Bad Request
< Date: Wed, 05 Mar 2025 11:45:36 GMT
< Set-Cookie: rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Tue, 04-Mar-2025 11:45:36 GMT; SameSite=lax
< Content-Type: text/plain
< Transfer-Encoding: chunked
< Server: Jetty(9.4.54.v20240208)
<
Cannot construct instance of `io.onedev.server.plugin.sso.openid.OpenIdConnector`, problem: `java.lang.NullPointerException`
 at [Source: (org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream); line: 1, column: 40] (through reference chain: java.util.ArrayList[0])

I'm facing for each other @type values except DiscordConnector. By inspecting the source code, my only guess was that the problem might be caused by buttonImageUrl

Can someone help me to find the reason, pls?

Thanks in advance!

  • OneDev changed state to 'Closed' 10 months ago
    Previous Value Current Value
    Open
    Closed
  • OneDev commented 10 months ago

    State changed as code fixing the issue is committed (829d274d)

  • OneDev changed state to 'Released' 10 months ago
    Previous Value Current Value
    Closed
    Released
  • OneDev commented 10 months ago

    State changed as build OD-5985 is successful

issue 1/1
Type
Bug
Priority
Normal
Assignee
Affected Versions
11.7.2
Labels
No labels
Issue Votes (0)
Watchers (2)
Reference
OD-2303
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover