Skip to content

Instantly share code, notes, and snippets.

curl --location --request POST 'https://mci.opi.org.pl/auth/realms/OPI/protocol/openid-connect/token'
--header 'Content-Type: application/x-www-form-urlencoded'
--data-urlencode 'client_id=polon2'
--data-urlencode 'grant_type=refresh_token'
--data-urlencode 'refresh_token=pobranyWcześniejOfflineToken'
curl --location --request POST 'https://mci.opi.org.pl/auth/realms/OPI/protocol/openid-connect/token'
--header 'Content-Type: application/x-www-form-urlencoded'
--data-urlencode 'client_id=polon2'
--data-urlencode 'grant_type=refresh_token'
--data-urlencode 'refresh_token=wczesniejPobranyOfflineToken'
--data-urlencode 'scope=offline_access'
{
"error": "invalid_grant",
"error_description": "Invalid user credentials"
}
{
"access_token": "ab....cd",
"expires_in": 900,
"refresh_expires_in": 1800,
"refresh_token": "ab....cd",
"token_type": "bearer",
"not-before-policy": 1618828653,
"session_state": "eeeeeeeeeee",
"scope": "offline_access"
}
curl --location --request POST 'https://mcl.opi.org.pl/auth/realms/OPI/protocol/openid-connect/token'
--header 'Content-Type: application/x-www-form-urlencoded'
--data-urlencode 'client_id=polon2'
--data-urlencode 'grant_type=password'
--data-urlencode 'username=nazwaUżytkownika'
--data-urlencode 'password=hasłoUżytkownika'
--data-urlencode 'scope=offline_access'
--data-urlencode 'totp=999999'
curl --location --request DELETE 'https://mci-dev.opi.org.pl/auth/realms/OPI/account/sessions/identyfikatorSesji'
--header 'Authorization: Bearer tokenDostępowyDoUnieważnienia'
--header 'Content-Type: application/json'
curl --location --request POST 'https://mci.opi.org.pl/auth/realms/OPI/protocol/openid-connect/token'
--header 'Content-Type: application/x-www-form-urlencoded'
--data-urlencode 'client_id=polon2'
--data-urlencode 'grant_type=refresh_token'
--data-urlencode 'refresh_token=wczesniejPobranyRefreshToken'
{
"error": "invalid_grant",
"error_description": "Invalid user credentials"
}
{
"access_token": "ab....cd",
"expires_in": 900,
"refresh_expires_in": 1800,
"refresh_token": "ab....cd",
"token_type": "bearer",
"not-before-policy": 1618828653,
"session_state": "eeeeeeeeeee",
"scope": ""
}
curl --location --request POST 'https://mcl.opi.org.pl/auth/realms/OPI/protocol/openid-connect/token'
--header 'Content-Type: application/x-www-form-urlencoded'
--data-urlencode 'client_id=polon2'
--data-urlencode 'grant_type=password'
--data-urlencode 'username=nazwaUżytkownika'
--data-urlencode 'password=hasłoUżytkownika'
--data-urlencode 'totp=999999'