Skip to content

Instantly share code, notes, and snippets.

@sandipchitale
Last active May 8, 2023 07:35
Show Gist options
  • Save sandipchitale/63ac27d666798aef706309255293b5f0 to your computer and use it in GitHub Desktop.
Save sandipchitale/63ac27d666798aef706309255293b5f0 to your computer and use it in GitHub Desktop.
Dump object using ObjectMapper #springframework
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.enable(SerializationFeature.INDENT_OUTPUT); //pretty print
try {
System.out.println(objectMapper.writeValueAsString(ANY_OBJECT));
} catch (JsonProcessingException e) {
}
/*
Output:
{
"registrationId" : "okta",
"clientId" : "0oa9fkf9a744SMgHt5d7",
"clientSecret" : "LQK75daBc9IobYOoIrbXnJXV4Ew_v_AUGexdgAMA",
"clientAuthenticationMethod" : {
"value" : "client_secret_basic"
},
"authorizationGrantType" : {
"value" : "client_credentials"
},
"redirectUri" : "{baseUrl}/{action}/oauth2/code/{registrationId}",
"scopes" : [ "okta.myAccount.email.read" ],
"providerDetails" : {
"authorizationUri" : "https://dev-76041835.okta.com/oauth2/default/v1/authorize",
"tokenUri" : "https://dev-76041835.okta.com/oauth2/default/v1/token",
"userInfoEndpoint" : {
"uri" : "https://dev-76041835.okta.com/oauth2/default/v1/userinfo",
"authenticationMethod" : {
"value" : "header"
},
"userNameAttributeName" : "sub"
},
"jwkSetUri" : "https://dev-76041835.okta.com/oauth2/default/v1/keys",
"issuerUri" : "https://dev-76041835.okta.com/oauth2/default",
"configurationMetadata" : {
"authorization_endpoint" : "https://dev-76041835.okta.com/oauth2/default/v1/authorize",
"token_endpoint" : "https://dev-76041835.okta.com/oauth2/default/v1/token",
"registration_endpoint" : "https://dev-76041835.okta.com/oauth2/v1/clients",
"introspection_endpoint" : "https://dev-76041835.okta.com/oauth2/default/v1/introspect",
"revocation_endpoint" : "https://dev-76041835.okta.com/oauth2/default/v1/revoke",
"pushed_authorization_request_endpoint" : "https://dev-76041835.okta.com/oauth2/default/v1/par",
"device_authorization_endpoint" : "https://dev-76041835.okta.com/oauth2/default/v1/device/authorize",
"issuer" : "https://dev-76041835.okta.com/oauth2/default",
"jwks_uri" : "https://dev-76041835.okta.com/oauth2/default/v1/keys",
"scopes_supported" : [ "okta.myAccount.email.manage", "okta.myAccount.email.read", "okta.myAccount.manage", "okta.myAccount.phone.manage", "okta.myAccount.phone.read", "okta.myAccount.profile.manage", "okta.myAccount.profile.read", "okta.myAccount.read", "openid", "profile", "email", "address", "phone", "offline_access", "device_sso" ],
"response_types_supported" : [ "code", "id_token", "code id_token", "code token", "id_token token", "code id_token token" ],
"response_modes_supported" : [ "query", "fragment", "form_post", "okta_post_message" ],
"grant_types_supported" : [ "authorization_code", "implicit", "refresh_token", "password", "urn:ietf:params:oauth:grant-type:device_code" ],
"code_challenge_methods_supported" : [ "S256" ],
"token_endpoint_auth_methods_supported" : [ "client_secret_basic", "client_secret_post", "client_secret_jwt", "private_key_jwt", "none" ],
"introspection_endpoint_auth_methods_supported" : [ "client_secret_basic", "client_secret_post", "client_secret_jwt", "private_key_jwt", "none" ],
"revocation_endpoint_auth_methods_supported" : [ "client_secret_basic", "client_secret_post", "client_secret_jwt", "private_key_jwt", "none" ],
"request_object_signing_alg_values_supported" : [ "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "ES256", "ES384", "ES512" ],
"request_parameter_supported" : true,
"request_uri_parameter_supported" : true,
"subject_types_supported" : [ "public" ],
"userinfo_endpoint" : "https://dev-76041835.okta.com/oauth2/default/v1/userinfo",
"end_session_endpoint" : "https://dev-76041835.okta.com/oauth2/default/v1/logout",
"id_token_signing_alg_values_supported" : [ "RS256" ],
"claims_supported" : [ "iss", "ver", "sub", "aud", "iat", "exp", "jti", "auth_time", "amr", "idp", "nonce", "name", "nickname", "preferred_username", "given_name", "middle_name", "family_name", "email", "email_verified", "profile", "zoneinfo", "locale", "address", "phone_number", "picture", "website", "gender", "birthdate", "updated_at", "at_hash", "c_hash" ]
}
},
"clientName" : "sandipchitale"
}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment