Wednesday, July 24, 2019

We continue with our discussion on sample calls using Kubernetes admin rest API.
Sample calls:
curl -i -k -u admin:password 'http://localhost:8080/auth/realms/master/protocol/openid-connect/token' -X POST -d 'grant_type=password' -d 'client_id=admin-cli' -d 'username=admin' -d 'password=password'
HTTP/1.1 200 OK
Server: nginx/1.15.10
Date: Tue, 23 Jul 2019 18:45:19 GMT
Content-Type: application/json
Content-Length: 1921
Connection: keep-alive
Vary: Accept-Encoding
Cache-Control: no-store
Set-Cookie: KC_RESTART=; Version=1; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Max-Age=0; Path=/auth/realms/master/; HttpOnly
Pragma: no-cache

{"access_token":"eyJhbGc_<trimmed>_K9G1ApFj01Q","expires_in":60,"refresh_expires_in":1800,"refresh_token":"eyJhb_<trimmed>_94","token_type":"bearer","not-before-policy":0,"session_state":"91be6030-ecf2-4744-b9db-6d70caf75a6d","scope":"profile email"}

curl -i -k 'http://localhost:8080/auth/admin/realms/master/roles/' -H 'Authorization: Bearer eyJhbGc_<trimmed>_K9G1ApFj01Q'

#
# curl -i -k 'http://localhost:8080/auth/admin/realms/master/roles/' -H 'Authorization: Bearer eyJhbGc_<trimmed>_K9G1ApFj01Q'
HTTP/1.1 200 OK
Server: nginx/1.15.10
Date: Tue, 23 Jul 2019 19:17:14 GMT
Content-Type: application/json
Content-Length: 804
Connection: keep-alive
Vary: Accept-Encoding
Cache-Control: no-cache

[{"id":"d73bf354-fb63-4a2e-8e61-a91cae1d9302","name":"uma_authorization","description":"${role_uma_authorization}","composite":false,"clientRole":false,"containerId":"master"},{"id":"b731700b-d023-4cf0-83b6-cb858337c331","name":"user","composite":false,"clientRole":false,"containerId":"master"},{"id":"6abfcdf0-24bf-4fb5-bddc-1f6781c7a158","name":"admin","composite":true,"clientRole":false,"containerId":"master"},{"id":"2154a5ad-55db-4950-acdd-1932cfb27ce7","name":"project1-member","description":"Provides access to resources for namespace 'master-system'.","composite":false,"clientRole":false,"containerId":"master"},{"id":"1a45fb30-cd43-4afe-8348-644ccecfb303","name":"offline_access","description":"${role_offline-access}","composite":false,"clientRole":false,"containerId":"master"}] #


curl -i -k 'http://localhost:8080/auth/admin/realms/master/clients/' -H 'Authorization: Bearer eyJhbGc_<trimmed>_K9G1ApFj01Q'
HTTP/1.1 200 OK
Server: nginx/1.15.10
Date: Tue, 23 Jul 2019 19:39:59 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
Vary: Accept-Encoding
Cache-Control: no-cache

[{"id":"1f913347-16eb-4914-901d-63df062c7f17","clientId":"realm-management","name":"${client_realm-management}","surrogateAuthRequired":false,"enabled":true,"clientAuthenticatorType":"client-secret","redirectUris":[],"webOrigins":[],"notBefore":0,"bearerOnly":true,"consentRequired":false,"standardFlowEnabled":true,"implicitFlowEnabled":false,"directAccessGrantsEnabled":false,"serviceAccountsEnabled":false,"publicClient":false,"frontchannelLogout":false,"protocol":"openid-connect","attributes":{},"authenticationFlowBindingOverrides":{},"fullScopeAllowed":false,"nodeReRegistrationTimeout":0,"protocolMappers":[{"id":"7606ca45-f717-4166-9da2-5da6af7e6834","name":"docker-v2-allow-all-mapper","protocol":"docker-v2","protocolMapper":"docker-v2-allow-all-mapper","consentRequired":false,"config":{}}],"defaultClientScopes":["web-origins","role_list","roles","profile","email"],"optionalClientScopes":["address","phone","offline_access"],"access":{"view":true,"configure":true,"manage":true}},{"id":"368ed8fc-7f93-4236-b29d-463383c46e49","clientId":"account","name":"${client_account}","baseUrl":"/auth/realms/master/account","surrogateAuthRequired":false,"enabled":true,"clientAuthenticatorType":"client-secret","defaultRoles":["view-profile","manage-account"],"redirectUris":["/auth/realms/master/account/*"],"webOrigins":[],"notBefore":0,"bearerOnly":false,"consentRequired":false,"standardFlowEnabled":true,"implicitFlowEnabled":false,"directAccessGrantsEnabled":false,"serviceAccountsEnabled":false,"publicClient":false,"frontchannelLogout":false,"protocol":"openid-connect","attributes":{},"authenticationFlowBindingOverrides":{},"fullScopeAllowed":false,"nodeReRegistrationTimeout":0,"protocolMappers":[{"id":"8a5319db-0351-4500-a42e-caa382047771","name":"docker-v2-allow-all-mapper","protocol":"docker-v2","protocolMapper":"docker-v2-allow-all-mapper","consentRequired":false,"config":{}}],"defaultClientScopes":["web-origins","role_list","roles","profile","email"],"optionalClientScopes":["address","phone","offline_access"],"access":{"view":true,"configure":true,"manage":true}},{"id":"d8f4b92c-b2dc-499c-96a5-01b15f3fd721","clientId":"project1-repo","name":"project1-repo","surrogateAuthRequired":false,"enabled":true,"clientAuthenticatorType":"client-secret","redirectUris":[],"webOrigins":[],"notBefore":0,"bearerOnly":false,"consentRequired":false,"standardFlowEnabled":false,"implicitFlowEnabled":false,"directAccessGrantsEnabled":true,"serviceAccountsEnabled":false,"publicClient":false,"frontchannelLogout":false,"protocol":"openid-connect","attributes":{"serviceInstanceID":"c6d09f4a-ad6d-11e9-b875-02505600310c","planID":"42b1c543-7207-408c-a2ec-9c34182f50991","bindingID":"c6d2d31a-ad6d-11e9-b875-02505600310c"},"authenticationFlowBindingOverrides":{},"fullScopeAllowed":true,"nodeReRegistrationTimeout":-1,"protocolMappers":[{"id":"363d2abb-1532-48ee-816a-eea23a397790","name":"docker-v2-allow-all-mapper","protocol":"docker-v2","protocolMapper":"docker-v2-allow-all-mapper","consentRequired":false,"config":{}}],"defaultClientScopes":["web-origins","project1-repo","role_list","profile","roles","email"],"optionalClientScopes":["address","phone","offline_access"],"access":{"view":true,"configure":true,"manage":true}},{"id":"e4bc688e-af1a-46f9-a629-a81b24ef01c3","clientId":"master-cli","surrogateAuthRequired":false,"enabled":true,"clientAuthenticatorType":"client-secret","redirectUris":[],"webOrigins":[],"notBefore":0,"bearerOnly":false,"consentRequired":false,"standardFlowEnabled":false,"implicitFlowEnabled":false,"directAccessGrantsEnabled":true,"serviceAccountsEnabled":false,"publicClient":true,"frontchannelLogout":false,"protocol":"openid-connect","attributes":{"saml.assertion.signature":"false","saml.force.post.binding":"false","saml.multivalued.roles":"false","saml.encrypt":"false","saml.server.signature":"false","saml.server.signature.keyinfo.ext":"false","exclude.session.state.from.auth.response":"false","saml_force_name_id_format":"false","saml.client.signature":"false","tls.client.certificate.bound.access.tokens":"false","saml.authnstatement":"false","display.on.consent.screen":"false","saml.onetimeuse.condition":"false"},"authenticationFlowBindingOverrides":{},"fullScopeAllowed":true,"nodeReRegistrationTimeout":-1,"protocolMappers":[{"id":"0a07cf37-9b99-4427-9d3d-272d21c1d14c","name":"docker-v2-allow-all-mapper","protocol":"docker-v2","protocolMapper":"docker-v2-allow-all-mapper","consentRequired":false,"config":{}}],"defaultClientScopes":["web-origins","role_list","roles","profile","email"],"optionalClientScopes":["address","phone","offline_access"],"access":{"view":true,"configure":true,"manage":true}},{"id":"1a807aa4-c255-4784-97fe-54e1dc866f3f","clientId":"project1-flink","name":"project1-flink","surrogateAuthRequired":false,"enabled":true,"clientAuthenticatorType":"client-secret","redirectUris":["*"],"webOrigins":["+"],"notBefore":0,"bearerOnly":false,"consentRequired":false,"standardFlowEnabled":true,"implicitFlowEnabled":false,"directAccessGrantsEnabled":false,"serviceAccountsEnabled":true,"publicClient":false,"frontchannelLogout":false,"protocol":"openid-connect","attributes":{"serviceInstanceID":"c6c1d4b4-ad6d-11e9-b875-02505600310c","planID":"42b1c543-7207-408c-a2ec-9c34182f50988","bindingID":"c6c2615a-ad6d-11e9-b875-02505600310c"},"authenticationFlowBindingOverrides":{},"fullScopeAllowed":true,"nodeReRegistrationTimeout":-1,"protocolMappers":[{"id":"86bba63f-e4ec-40c0-b1e6-4d78fd6d3f99","name":"Client ID","protocol":"openid-connect","protocolMapper":"oidc-usersessionmodel-note-mapper","consentRequired":false,"config":{"user.session.note":"clientId","id.token.claim":"true","access.token.claim":"true","claim.name":"clientId","jsonType.label":"String"}},{"id":"dfceafff-ae50-4dd4-94d0-62123ba83e26","name":"Client IP Address","protocol":"openid-connect","protocolMapper":"oidc-usersessionmodel-note-mapper","consentRequired":false,"config":{"user.session.note":"clientAddress","id.token.claim":"true","access.token.claim":"true","claim.name":"clientAddress","jsonType.label":"String"}},{"id":"4567f93e-67b7-4925-9b61-99d1012222ed","name":"Client Host","protocol":"openid-connect","protocolMapper":"oidc-usersessionmodel-note-mapper","consentRequired":false,"config":{"user.session.note":"clientHost","id.token.claim":"true","access.token.claim":"true","claim.name":"clientHost","jsonType.label":"String"}},{"id":"e912b822-c63d-4499-8452-37c7b3bac5a1","name":"docker-v2-allow-all-mapper","protocol":"docker-v2","protocolMapper":"docker-v2-allow-all-mapper","consentRequired":false,"config":{}}],"defaultClientScopes":["web-origins","role_list","project1-flink","profile","roles","email"],"optionalClientScopes":["address","phone","offline_access"],"access":{"view":true,"configure":true,"manage":true}},{"id":"375d646f-f83e-44b9-9c81-9026fea20f70","clientId":"broker","name":"${client_broker}","surrogateAuthRequired":false,"enabled":true,"clientAuthenticatorType":"client-secret","redirectUris":[],"webOrigins":[],"notBefore":0,"bearerOnly":false,"consentRequired":false,"standardFlowEnabled":true,"implicitFlowEnabled":false,"directAccessGrantsEnabled":false,"serviceAccountsEnabled":false,"publicClient":false,"frontchannelLogout":false,"protocol":"openid-connect","attributes":{},"authenticationFlowBindingOverrides":{},"fullScopeAllowed":false,"nodeReRegistrationTimeout":0,"protocolMappers":[{"id":"d761c7d1-fc2f-42a8-be93-efcd69134a04","name":"docker-v2-allow-all-mapper","protocol":"docker-v2","protocolMapper":"docker-v2-allow-all-mapper","consentRequired":false,"config":{}}],"defaultClientScopes":["web-origins","role_list","roles","profile","email"],"optionalClientScopes":["address","phone","offline_access"],"access":{"view":true,"configure":true,"manage":true}},{"id":"2b96d311-8a72-4425-9762-a5832ba814d1","clientId":"security-admin-console","name":"${client_security-admin-console}","baseUrl":"/auth/admin/master/console/index.html","surrogateAuthRequired":false,"enabled":true,"clientAuthenticatorType":"client-secret","redirectUris":["/auth/admin/master/console/*"],"webOrigins":[],"notBefore":0,"bearerOnly":false,"consentRequired":false,"standardFlowEnabled":true,"implicitFlowEnabled":false,"directAccessGrantsEnabled":false,"serviceAccountsEnabled":false,"publicClient":true,"frontchannelLogout":false,"protocol":"openid-connect","attributes":{},"authenticationFlowBindingOverrides":{},"fullScopeAllowed":false,"nodeReRegistrationTimeout":0,"protocolMappers":[{"id":"329747cf-d72f-41ca-b2ac-b685561aaddc","name":"locale","protocol":"openid-connect","protocolMapper":"oidc-usermodel-attribute-mapper","consentRequired":false,"config":{"userinfo.token.claim":"true","user.attribute":"locale","id.token.claim":"true","access.token.claim":"true","claim.name":"locale","jsonType.label":"String"}}],"defaultClientScopes":["web-origins","role_list","roles","profile","email"],"optionalClientScopes":["address","phone","offline_access"],"access":{"view":true,"configure":true,"manage":true}},{"id":"dae45177-8406-4ba5-be8d-f81541e7ee97","clientId":"master-ui","name":"DellEMC Stream Processing Platform UI","surrogateAuthRequired":false,"enabled":true,"clientAuthenticatorType":"client-secret","redirectUris":["http://frog-man.lab-oxygen.demo.masterbeta.com/*","http://localhost:9000/*"],"webOrigins":["http://frog-man.lab-oxygen.demo.masterbeta.com","http://localhost:9000"],"notBefore":0,"bearerOnly":false,"consentRequired":false,"standardFlowEnabled":false,"implicitFlowEnabled":true,"directAccessGrantsEnabled":false,"serviceAccountsEnabled":false,"publicClient":true,"frontchannelLogout":false,"protocol":"openid-connect","attributes":{"serviceInstanceID":"de8d629f-a8ea-11e9-ae64-02505600310c","planID":"42b1c543-7207-408c-a2ec-9c34182f50989","bindingID":"de80aa90-a8ea-11e9-ae64-02505600310c"},"authenticationFlowBindingOverrides":{},"fullScopeAllowed":true,"nodeReRegistrationTimeout":-1,"protocolMappers":[{"id":"f662d042-fe40-4b16-92ee-ab53655516cd","name":"docker-v2-allow-all-mapper","protocol":"docker-v2","protocolMapper":"docker-v2-allow-all-mapper","consentRequired":false,"config":{}}],"defaultClientScopes":["web-origins","role_list","profile","roles","master-ui","email"],"optionalClientScopes":["address","phone","offline_access"],"access":{"view":true,"configure":true,"manage":true}},{"id":"f043e6d3-acec-4e79-9f15-2e4ded24718a","clientId":"project1-pravega","name":"project1-pravega","surrogateAuthRequired":false,"enabled":true,"clientAuthenticatorType":"client-secret","redirectUris":[],"webOrigins":[],"notBefore":0,"bearerOnly":false,"consentRequired":false,"standardFlowEnabled":false,"implicitFlowEnabled":false,"directAccessGrantsEnabled":false,"serviceAccountsEnabled":true,"publicClient":false,"frontchannelLogout":false,"protocol":"openid-connect","attributes":{"serviceInstanceID":"c6bb43b9-ad6d-11e9-b875-02505600310c","planID":"42b1c543-7207-408c-a2ec-9c34182f50988","bindingID":"c6c0a12c-ad6d-11e9-b875-02505600310c"},"authenticationFlowBindingOverrides":{},"fullScopeAllowed":true,"nodeReRegistrationTimeout":-1,"protocolMappers":[{"id":"30d0b1ff-7eb4-40d9-a8c2-dcacb5dae4d7","name":"Client IP Address","protocol":"openid-connect","protocolMapper":"oidc-usersessionmodel-note-mapper","consentRequired":false,"config":{"user.session.note":"clientAddress","id.token.claim":"true","access.token.claim":"true","claim.name":"clientAddress","jsonType.label":"String"}},{"id":"1ed5020d-6cb4-4fc8-9bbf-deeac91a7fb8","name":"Client Host","protocol":"openid-connect","protocolMapper":"oidc-usersessionmodel-note-mapper","consentRequired":false,"config":{"user.session.note":"clientHost","id.token.claim":"true","access.token.claim":"true","claim.name":"clientHost","jsonType.label":"String"}},{"id":"ab51bc73-709b-48db-8226-4fe292d39001","name":"docker-v2-allow-all-mapper","protocol":"docker-v2","protocolMapper":"docker-v2-allow-all-mapper","consentRequired":false,"config":{}},{"id":"85c47dc2-6b02-49dd-b9c2-9ad15780a665","name":"Client ID","protocol":"openid-connect","protocolMapper":"oidc-usersessionmodel-note-mapper","consentRequired":false,"config":{"user.session.note":"clientId","id.token.claim":"true","access.token.claim":"true","claim.name":"clientId","jsonType.label":"String"}}],"defaultClientScopes":["web-origins","role_list","profile","roles","project1-pravega","email"],"optionalClientScopes":["address","phone","offline_access"],"access":{"view":true,"configure":true,"manage":true}},{"id":"8f665d0f-bad9-4567-bdf0-7d96ecdf04cb","clientId":"kcsa-manager","name":"kcsa-manager","surrogateAuthRequired":false,"enabled":true,"clientAuthenticatorType":"client-secret","redirectUris":[],"webOrigins":[],"notBefore":0,"bearerOnly":false,"consentRequired":false,"standardFlowEnabled":false,"implicitFlowEnabled":false,"directAccessGrantsEnabled":false,"serviceAccountsEnabled":true,"publicClient":false,"frontchannelLogout":false,"protocol":"openid-connect","attributes":{},"authenticationFlowBindingOverrides":{},"fullScopeAllowed":true,"nodeReRegistrationTimeout":-1,"protocolMappers":[{"id":"010a6558-0217-4ea9-91f2-18e6bd4518ba","name":"docker-v2-allow-all-mapper","protocol":"docker-v2","protocolMapper":"docker-v2-allow-all-mapper","consentRequired":false,"config":{}},{"id":"635412eb-602b-4701-b4ae-2f17a83dc312","name":"Client IP Address","protocol":"openid-connect","protocolMapper":"oidc-usersessionmodel-note-mapper","consentRequired":false,"config":{"user.session.note":"clientAddress","id.token.claim":"true","access.token.claim":"true","claim.name":"clientAddress","jsonType.label":"String"}},{"id":"7abf0cd9-6157-4f77-932a-a30ebeabd652","name":"Client ID","protocol":"openid-connect","protocolMapper":"oidc-usersessionmodel-note-mapper","consentRequired":false,"config":{"user.session.note":"clientId","id.token.claim":"true","access.token.claim":"true","claim.name":"clientId","jsonType.label":"String"}},{"id":"b6dd8329-2328-4355-90ca-753dafe4f7d1","name":"Client Host","protocol":"openid-connect","protocolMapper":"oidc-usersessionmodel-note-mapper","consentRequired":false,"config":{"user.session.note":"clientHost","id.token.claim":"true","access.token.claim":"true","claim.name":"clientHost","jsonType.label":"String"}}],"defaultClientScopes":["web-origins","role_list","profile","roles","email"],"optionalClientScopes":["address","phone","offline_access"],"access":{"view":true,"configure":true,"manage":true}},{"id":"8306ff5e-e770-40e7-a361-ab5cfc5d4157","clientId":"grafana","name":"grafana","surrogateAuthRequired":false,"enabled":true,"clientAuthenticatorType":"client-secret","redirectUris":["http://grafana.frog-man.lab-oxygen.demo.masterbeta.com/*"],"webOrigins":["http://grafana.frog-man.lab-oxygen.demo.masterbeta.com"],"notBefore":0,"bearerOnly":false,"consentRequired":false,"standardFlowEnabled":true,"implicitFlowEnabled":false,"directAccessGrantsEnabled":false,"serviceAccountsEnabled":false,"publicClient":false,"frontchannelLogout":false,"protocol":"openid-connect","attributes":{"serviceInstanceID":"eee21f41-a8ea-11e9-ae64-02505600310c","planID":"42b1c543-7207-408c-a2ec-9c34182f50991","bindingID":"eed44cba-a8ea-11e9-ae64-02505600310c"},"authenticationFlowBindingOverrides":{},"fullScopeAllowed":true,"nodeReRegistrationTimeout":-1,"protocolMappers":[{"id":"5228794f-9ff3-44ee-b6a3-9112880b9b5b","name":"docker-v2-allow-all-mapper","protocol":"docker-v2","protocolMapper":"docker-v2-allow-all-mapper","consentRequired":false,"config":{}}],"defaultClientScopes":["web-origins","role_list","grafana","profile","roles","email"],"optionalClientScopes":["address","phone","offline_access"],"access":{"view":true,"configure":true,"manage":true}},{"id":"671fddf5-7bd7-452c-8300-c97337cd9d1d","clientId":"admin-cli","name":"${client_admin-cli}","surrogateAuthRequired":false,"enabled":true,"clientAuthenticatorType":"client-secret","redirectUris":[],"webOrigins":[],"notBefore":0,"bearerOnly":false,"consentRequired":false,"standardFlowEnabled":false,"implicitFlowEnabled":false,"directAccessGrantsEnabled":true,"serviceAccountsEnabled":false,"publicClient":true,"frontchannelLogout":false,"protocol":"openid-connect","attributes":{},"authenticationFlowBindingOverrides":{},"fullScopeAllowed":false,"nodeReRegistrationTimeout":0,"protocolMappers":[{"id":"93e826bb-1c1c-4d5c-bf19-177ec06996b3","name":"docker-v2-allow-all-mapper","protocol":"docker-v2","protocolMapper":"docker-v2-allow-all-mapper","consentRequired":false,"config":{}}],"defaultClientScopes":["web-origins","role_list","roles","profile","email"],"optionalClientScopes":["address","phone","offline_access"],"access":{"view":true,"configure":true,"manage":true}},{"id":"38adb0ea-d81f-4cc5-b9c3-4786ad46fbea","clientId":"pravega-controller","name":"pravega-controller","surrogateAuthRequired":false,"enabled":true,"clientAuthenticatorType":"client-secret","redirectUris":[],"webOrigins":[],"notBefore":0,"bearerOnly":false,"consentRequired":false,"standardFlowEnabled":false,"implicitFlowEnabled":false,"directAccessGrantsEnabled":false,"serviceAccountsEnabled":true,"authorizationServicesEnabled":true,"publicClient":false,"frontchannelLogout":false,"protocol":"openid-connect","attributes":{"serviceInstanceID":"eef102ef-a8ea-11e9-ae64-02505600310c","planID":"42b1c543-7207-408c-a2ec-9c34182f50988","bindingID":"eee1947c-a8ea-11e9-ae64-02505600310c"},"authenticationFlowBindingOverrides":{},"fullScopeAllowed":true,"nodeReRegistrationTimeout":-1,"protocolMappers":[{"id":"5cef8eda-193b-48a5-9299-62c805b6b42e","name":"Client IP Address","protocol":"openid-connect","protocolMapper":"oidc-usersessionmodel-note-mapper","consentRequired":false,"config":{"user.session.note":"clientAddress","id.token.claim":"true","access.token.claim":"true","claim.name":"clientAddress","jsonType.label":"String"}},{"id":"aaf6e57b-18b8-455b-a9fb-40340a5b84bb","name":"docker-v2-allow-all-mapper","protocol":"docker-v2","protocolMapper":"docker-v2-allow-all-mapper","consentRequired":false,"config":{}},{"id":"17947fed-238a-4399-a146-0c37adead31c","name":"Client ID","protocol":"openid-connect","protocolMapper":"oidc-usersessionmodel-note-mapper","consentRequired":false,"config":{"user.session.note":"clientId","id.token.claim":"true","access.token.claim":"true","claim.name":"clientId","jsonType.label":"String"}},{"id":"5dab1482-a4c0-4047-886c-7047bff176a0","name":"Client Host","protocol":"openid-connect","protocolMapper":"oidc-usersessionmodel-note-mapper","consentRequired":false,"config":{"user.session.note":"clientHost","id.token.claim":"true","access.token.claim":"true","claim.name":"clientHost","jsonType.label":"String"}}],"defaultClientScopes":["web-origins","role_list","profile","roles","pravega-controller","email"],"optionalClientScopes":["address","phone","offline_access"],"access":{"view":true,"configure":true,"manage":true}}]



# curl -i -k 'http://localhost:8080/auth/admin/realms/master/clients/d8f4b92c-b2dc-499c-96a5-01b15f3fd721/roles/' -H 'Authorization: Bearer eyJhbGc_<trimmed>_K9G1ApFj01Q'
HTTP/1.1 200 OK
Server: nginx/1.15.10
Date: Tue, 23 Jul 2019 19:55:35 GMT
Content-Type: application/json
Content-Length: 2
Connection: keep-alive
Cache-Control: no-cache

# curl -i -k 'http://localhost:8080/auth/admin/realms/master/clients/d8f4b92c-b2dc-499c-96a5-01b15f3fd721' -H 'Authorization: Bearer eyJhbGc_<trimmed>_K9G1ApFj01Q'
HTTP/1.1 200 OK
Server: nginx/1.15.10
Date: Tue, 23 Jul 2019 19:55:55 GMT
Content-Type: application/json
Content-Length: 1151
Connection: keep-alive
Vary: Accept-Encoding
Cache-Control: no-cache

{"id":"d8f4b92c-b2dc-499c-96a5-01b15f3fd721","clientId":"project1-repo","name":"project1-repo","surrogateAuthRequired":false,"enabled":true,"clientAuthenticatorType":"client-secret","redirectUris":[],"webOrigins":[],"notBefore":0,"bearerOnly":false,"consentRequired":false,"standardFlowEnabled":false,"implicitFlowEnabled":false,"directAccessGrantsEnabled":true,"serviceAccountsEnabled":false,"publicClient":false,"frontchannelLogout":false,"protocol":"openid-connect","attributes":{"serviceInstanceID":"c6d09f4a-ad6d-11e9-b875-02505600310c","planID":"42b1c543-7207-408c-a2ec-9c34182f50991","bindingID":"c6d2d31a-ad6d-11e9-b875-02505600310c"},"authenticationFlowBindingOverrides":{},"fullScopeAllowed":true,"nodeReRegistrationTimeout":-1,"protocolMappers":[{"id":"363d2abb-1532-48ee-816a-eea23a397790","name":"docker-v2-allow-all-mapper","protocol":"docker-v2","protocolMapper":"docker-v2-allow-all-mapper","consentRequired":false,"config":{}}],"defaultClientScopes":["web-origins","project1-repo","role_list","profile","roles","email"],"optionalClientScopes":["address","phone","offline_access"],"access":{"view":true,"configure":true,"manage":true}}



#codingexercise

Count the number of nodes in a circular linked list
Integer count (Node start) {
Integer count = 0;
If (start == null) return count;
count +=1;
If (start.next == start) return count;
Node cur = start;
while (cur.next != start) {
    count += 1;
    cur = cur.next;
}
return count;
}


Find if two strings are interleaved in a third string


        static bool isInterleaved(String A, String B, String C)

        {

            int ia = 0;

            int ib = 0;

            for (int i = 0; i < C.Length; i++)

            {

                if (ia < A.Length && C[i] == A[ia])

                {

                    ia++;

                }

                else if (ib < B.Length && C[i] == B[ib])

                {

                    ib++;

                }

                else

                return false;

               

            }

            if (ia != A.Length || ib != B.Length)

                return false;

            return true;

        }

No comments:

Post a Comment