Unable to configure OpenID Provider via REST API (OD-2643)
Deven Phillips opened 2 weeks ago

I have checked the API Docs (https://[my server]/~help/api) and I cannot find any reference to how to configure an OpenID provider.

I also searched through the issues and saw a few posts and tried what was discussed there without success:

curl -u<user>:<pass> [email protected] https://[my server]/~api/settings/sso-connectors

and a few other variations. I also tried to replicate what the web UI does, but that all appears to be done through AJAX requests in Apache Wicket.

Is there a document or reference where I can find out how to configure an OpenID provider using the REST API?

Technically I am trying to do this via Ansible using the task below:

- name: Configure SSO Integration
  ansible.builtin.uri:
    url: "http://{{ onedev_ip }}:6610//~api/settings/sso-providers"
    url_username: "{{ onedev.admin.username }}"
    url_password: "{{ onedev.admin.password }}"
    method: POST
    body_format: json
    body: "{{ lookup('ansible.builtin.template', 'sso.json.j2') }}"
    force_basic_auth: true
    status_code: [200, 201, 202]
  tags:
    - onedev

And the body is created from this template:

[
  {
    "@type": "OpenIdConnector",
    "configurationDiscoveryUrl": "http://keycloak:8080/realms/{{ keycloak.realm.name }}/.well-known/openid-configuration",
    "clientId": "{{ keycloak.realm.clients.onedev.client_id }}",
    "clientSecret": "{{ keycloak_onedev_client_secret }}",
    "requestScopes": "openid email profile",
    "groupsClaim": "groups",
    "buttonImageUrl": "/wicket/resource/io.onedev.server.plugin.sso.openid.OpenIdConnector/openid.png",
    "name": "onedev",
    "defaultGroup": ""
  }
]

Thanks in advance!

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