Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Add OAuth2 Client Credentials and access token use examples #170

Open
dsoper2 opened this issue Oct 28, 2024 · 0 comments

Comments

@dsoper2
Copy link
Contributor

dsoper2 commented Oct 28, 2024

Describe the bug
Feature request to add support for OAuth2 Client Credentials and access token use examples

Additional context
OAuth2 ClientId and ClientSecret can be used to generate an access (bearer) token with the following:

curl 'https://intersight.com/iam/token'
--header 'Content-Type: application/x-www-form-urlencoded'
--data-urlencode 'grant_type=client_credentials'
--data-urlencode 'client_id=46a7e36f289f9133bb1a15d154505a6093eaafa71314887df1427a8d45d7b526-636d24f77564612d3375a70f'
--data-urlencode 'client_secret=d0b8bfa099cc1723e87e1d9aec361…'

Response:

{"access_token":"eyJh...pg","expires_in":600,"token_type":"Bearer"}

The token can then be used to authenticate with any API resource:

curl 'https://intersight.com/api/v1/iam/Users' --header 'Authorization: Bearer e...pg'

Response:

"ObjectType": "iam.User.List",
"Results": [
{
"AccountMoid": "636d24f77564612d3375a70e",
"Ancestors": [
{
"ClassId": "mo.MoRef",
"Moid": "636d24f77564612d3375a711",
"ObjectType": "iam.IdpReference",

Request is to support in the module so that cmdlets can use Bearer tokens instead of API key based signing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant