Skip to content

Instantly share code, notes, and snippets.

@lapinek
Last active September 4, 2018 18:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lapinek/7941434a4e13b6f713c4300297e19b73 to your computer and use it in GitHub Desktop.
Save lapinek/7941434a4e13b6f713c4300297e19b73 to your computer and use it in GitHub Desktop.
AM 6.0 OAuth 2.0 public "pkce" client with cURL
curl 'http://am-service.sample.svc.cluster.local/openam/json/realms/root/realm-config/agents/OAuth2Client/pkce' \
-X PUT \
--data '{
"clientType": "Public",
"redirectionUris": ["http://localhost:9999"],
"scopes": ["openid"],
"responseTypes": ["code"],
"tokenEndpointAuthMethod": "client_secret_post",
"isConsentImplied": true,
"postLogoutRedirectUri": ["http://localhost:9999"]
}' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Cookie: iPlanetDirectoryPro='$(curl 'http://am-service.sample.svc.cluster.local/openam/json/realms/root/authenticate' \
-X POST \
-H 'X-OpenAM-Username:amadmin' \
-H 'X-OpenAM-Password:password' \
| sed -e 's/^.*"tokenId":"\([^"]*\)".*$/\1/' \
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment