ves-io-schema-oidc_provider-CustomAPI-Create

Examples of performing oidc_provider CustomAPI Create

Usecase:

Create azure provider

Request:

Request using vesctl:

vesctl request rpc oidc_provider.CustomAPI.Create -i request.yaml --uri /public/custom/namespaces/documentation/oidc_providers --http-method POST

where file request.yaml has following contents:

namespace: documentation
spec:
  azureOidcSpecType:
    authorizationUrl: https://test-authorization-url
    clientId: test client id
    clientSecret: client-secret
    tokenUrl: https://token-url
  providerType: AZURE

vesctl yaml response:

{}

Request using curl:

curl -X 'POST' -d '{"namespace":"documentation","spec":{"providerType":"AZURE","azureOidcSpecType":{"clientId":"test client id","clientSecret":"client-secret","authorizationUrl":"https://test-authorization-url","tokenUrl":"https://token-url"}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build013258245_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/custom/namespaces/documentation/oidc_providers'

curl response:

HTTP/1.1 200 OK
Content-Length: 79
Content-Type: application/json
Date: Wed, 16 Sep 2020 10:50:34 GMT
Vary: Accept-Encoding

{
  "redirect_uri": "",
  "post_logout_redirect_uri": "",
  "err": "EUNKNOWN"
}

Usecase:

Create google provider

Request:

Request using vesctl:

vesctl request rpc oidc_provider.CustomAPI.Create -i request.yaml --uri /public/custom/namespaces/documentation/oidc_providers --http-method POST

where file request.yaml has following contents:

namespace: documentation
spec:
  googleOidcSpecType:
    clientId: test client id
    clientSecret: client-secret
    hostedDomain: ves.io
  providerType: GOOGLE

vesctl yaml response:

{}

Request using curl:

curl -X 'POST' -d '{"namespace":"documentation","spec":{"providerType":"GOOGLE","googleOidcSpecType":{"clientId":"test client id","clientSecret":"client-secret","hostedDomain":"ves.io"}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build013258245_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/custom/namespaces/documentation/oidc_providers'

curl response:

HTTP/1.1 200 OK
Content-Length: 79
Content-Type: application/json
Date: Wed, 16 Sep 2020 10:50:34 GMT
Vary: Accept-Encoding

{
  "redirect_uri": "",
  "post_logout_redirect_uri": "",
  "err": "EUNKNOWN"
}

Usecase:

Create generic OIDC provider

Request:

Request using vesctl:

vesctl request rpc oidc_provider.CustomAPI.Create -i request.yaml --uri /public/custom/namespaces/documentation/oidc_providers --http-method POST

where file request.yaml has following contents:

namespace: documentation
spec:
  oidcV10SpecType:
    authorizationUrl: https://test-authorization-url
    clientId: test client id
    clientSecret: client-secret
    prompt: LOGIN
    tokenUrl: https://token-url

vesctl yaml response:

{}

Request using curl:

curl -X 'POST' -d '{"namespace":"documentation","spec":{"oidcV10SpecType":{"authorizationUrl":"https://test-authorization-url","tokenUrl":"https://token-url","clientId":"test client id","clientSecret":"client-secret","prompt":"LOGIN"}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build013258245_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/custom/namespaces/documentation/oidc_providers'

curl response:

HTTP/1.1 200 OK
Content-Length: 79
Content-Type: application/json
Date: Wed, 16 Sep 2020 10:50:34 GMT
Vary: Accept-Encoding

{
  "redirect_uri": "",
  "post_logout_redirect_uri": "",
  "err": "EUNKNOWN"
}

Usecase:

Create Okta OIDC provider

Request:

Request using vesctl:

vesctl request rpc oidc_provider.CustomAPI.Create -i request.yaml --uri /public/custom/namespaces/documentation/oidc_providers --http-method POST

where file request.yaml has following contents:

namespace: documentation
spec:
  oktaOidcSpecType:
    authorizationUrl: https://test-authorization-url
    clientId: test client id
    clientSecret: client-secret
    tokenUrl: https://token-url
  providerType: OKTA

vesctl yaml response:

{}

Request using curl:

curl -X 'POST' -d '{"namespace":"documentation","spec":{"providerType":"OKTA","oktaOidcSpecType":{"clientId":"test client id","clientSecret":"client-secret","authorizationUrl":"https://test-authorization-url","tokenUrl":"https://token-url"}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build013258245_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/custom/namespaces/documentation/oidc_providers'

curl response:

HTTP/1.1 200 OK
Content-Length: 79
Content-Type: application/json
Date: Wed, 16 Sep 2020 10:50:34 GMT
Vary: Accept-Encoding

{
  "redirect_uri": "",
  "post_logout_redirect_uri": "",
  "err": "EUNKNOWN"
}