0

I am implementing an OIDC client for which i want to read the rest end points from this web page.

https://login.bbmri-eric.eu/oidc/.well-known/openid-configuration

e.g. my application shoud have the key authorization_endpoint and it should read the value of this key from the above mentioned url.

Is there a way/library to read from such a web page without too many string checks?

overflow
  • 85
  • 1
  • 1
  • 8
  • Which language? You could either parse the JSON or extract the value of "authorization_endpoint" using String.indexOf and String.substring - but really, JSON parsing isn't that expensive. – maio290 Sep 17 '18 at 09:30
  • @maio290 I am woking with java. have added this info to the question. Do you mean that i read the complete web page into a json object and than extract what i need from this json object? Could you share some exaples to read such a page with json? – overflow Sep 17 '18 at 09:34

1 Answers1

0

If you hit https://login.bbmri-eric.eu/oidc/.well-known/openid-configuration in browser you get a json back as below. As mentioned in comments all you need is below code.

How to read json in java - one of many options is to include Apache Commons IOUtils & json.org libraries (download maven dependencies).

JSONObject jsonObject = new JSONObject(IOUtils.toString(new URL("https://login.bbmri-eric.eu/oidc/.well-known/openid-configuration"), Charset.forName("UTF-8")));

Now this jsonObject is java representation if JSON below. I hope you know how to work with java objects. If you don't read this guide or check this thread link

-- Your JSON--

{
  "request_parameter_supported": true,
  "claims_parameter_supported": false,
  "introspection_endpoint": "https://login.bbmri-eric.eu/oidc/introspect",
  "scopes_supported": [
    "openid",
    "offline_access"
  ],
  "issuer": "https://login.bbmri-eric.eu/oidc/",
  "userinfo_encryption_enc_values_supported": [
    "A256CBC+HS512",
    "A256GCM",
    "A192GCM",
    "A128GCM",
    "A128CBC-HS256",
    "A192CBC-HS384",
    "A256CBC-HS512",
    "A128CBC+HS256"
  ],
  "id_token_encryption_enc_values_supported": [
    "A256CBC+HS512",
    "A256GCM",
    "A192GCM",
    "A128GCM",
    "A128CBC-HS256",
    "A192CBC-HS384",
    "A256CBC-HS512",
    "A128CBC+HS256"
  ],
  "authorization_endpoint": "https://login.bbmri-eric.eu/oidc/authorize",
  "service_documentation": "https://login.bbmri-eric.eu/oidc/about",
  "request_object_encryption_enc_values_supported": [
    "A256CBC+HS512",
    "A256GCM",
    "A192GCM",
    "A128GCM",
    "A128CBC-HS256",
    "A192CBC-HS384",
    "A256CBC-HS512",
    "A128CBC+HS256"
  ],
  "device_authorization_endpoint": "https://login.bbmri-eric.eu/oidc/devicecode",
  "userinfo_signing_alg_values_supported": [
    "HS256",
    "HS384",
    "HS512",
    "RS256",
    "RS384",
    "RS512",
    "ES256",
    "ES384",
    "ES512",
    "PS256",
    "PS384",
    "PS512"
  ],
  "claims_supported": [
    "sub",
    "name",
    "preferred_username",
    "given_name",
    "family_name",
    "middle_name",
    "nickname",
    "profile",
    "picture",
    "website",
    "gender",
    "zoneinfo",
    "locale",
    "updated_at",
    "birthdate",
    "email",
    "email_verified",
    "phone_number",
    "phone_number_verified",
    "address"
  ],
  "claim_types_supported": [
    "normal"
  ],
  "op_policy_uri": "https://login.bbmri-eric.eu/oidc/about",
  "token_endpoint_auth_methods_supported": [
    "client_secret_post",
    "client_secret_basic",
    "client_secret_jwt",
    "private_key_jwt",
    "none"
  ],
  "token_endpoint": "https://login.bbmri-eric.eu/oidc/token",
  "response_types_supported": [
    "code",
    "token"
  ],
  "request_uri_parameter_supported": false,
  "userinfo_encryption_alg_values_supported": [
    "RSA-OAEP",
    "RSA-OAEP-256",
    "RSA1_5"
  ],
  "grant_types_supported": [
    "authorization_code",
    "implicit",
    "urn:ietf:params:oauth:grant-type:jwt-bearer",
    "client_credentials",
    "urn:ietf:params:oauth:grant_type:redelegate",
    "urn:ietf:params:oauth:grant-type:device_code"
  ],
  "end_session_endpoint": "https://login.bbmri-eric.eu/oidc/endsession",
  "revocation_endpoint": "https://login.bbmri-eric.eu/oidc/revoke",
  "userinfo_endpoint": "https://login.bbmri-eric.eu/oidc/userinfo",
  "token_endpoint_auth_signing_alg_values_supported": [
    "HS256",
    "HS384",
    "HS512",
    "RS256",
    "RS384",
    "RS512",
    "ES256",
    "ES384",
    "ES512",
    "PS256",
    "PS384",
    "PS512"
  ],
  "op_tos_uri": "https://login.bbmri-eric.eu/oidc/about",
  "require_request_uri_registration": false,
  "code_challenge_methods_supported": [
    "plain",
    "S256"
  ],
  "id_token_encryption_alg_values_supported": [
    "RSA-OAEP",
    "RSA-OAEP-256",
    "RSA1_5"
  ],
  "jwks_uri": "https://login.bbmri-eric.eu/oidc/jwk",
  "subject_types_supported": [
    "public",
    "pairwise"
  ],
  "id_token_signing_alg_values_supported": [
    "HS256",
    "HS384",
    "HS512",
    "RS256",
    "RS384",
    "RS512",
    "ES256",
    "ES384",
    "ES512",
    "PS256",
    "PS384",
    "PS512",
    "none"
  ],
  "registration_endpoint": "https://login.bbmri-eric.eu/oidc/register",
  "request_object_signing_alg_values_supported": [
    "HS256",
    "HS384",
    "HS512",
    "RS256",
    "RS384",
    "RS512",
    "ES256",
    "ES384",
    "ES512",
    "PS256",
    "PS384",
    "PS512"
  ],
  "request_object_encryption_alg_values_supported": [
    "RSA-OAEP",
    "RSA-OAEP-256",
    "RSA1_5"
  ]
}
Sheetal Mohan Sharma
  • 2,908
  • 1
  • 23
  • 24