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

fix(console): fix m2m guide curl code syntax error #5923

Merged
merged 1 commit into from
May 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 27 additions & 23 deletions packages/console/src/assets/docs/guides/m2m-general/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,16 @@ If you are using cURL:

<pre>
<code className="language-bash">
{`curl --location
--request POST '${appendPath(props.endpoint, '/oidc/token')}'
{`curl --location '${appendPath(props.endpoint, '/oidc/token')}' \\
--request POST \\
# Credentials are constructed by "<app-id>:<app-secret>" and encoded in base64
--header 'Authorization: Basic ${Buffer.from(`${props.app.id}:${props.app.secret}`).toString(
'base64'
)}'
--header 'Content-Type: application/x-www-form-urlencoded'
--data-urlencode 'grant_type=client_credentials'
--data-urlencode 'resource=https://shopping.api'
--data-urlencode 'scope=scope_1 scope_2'
)}' \\
--header 'Content-Type: application/x-www-form-urlencoded' \\
--data-urlencode 'grant_type=client_credentials' \\
--data-urlencode 'resource=https://shopping.api' \\
--data-urlencode 'scope=scope_1 scope_2' # Optional scope(s)
`}
</code>
</pre>
Expand Down Expand Up @@ -115,27 +115,31 @@ Here is an example of using cURL to send a GET request to get items in your shop
</Step>
<Step title="Enable admin access" subtitle="(optional)">

### Accessing Logto Management API
### Accessing Logto Management API

If you want to use this m2m app to access Logto [Management API](https://docs.logto.io/docs/references/core/#management-api).

You should go to "Roles" tab and create a new machine-to-machine role with the permission of management API.

If you want to use this m2m app to access Logto [Management API](https://docs.logto.io/docs/references/core/#management-api).
{' '}

You should go to "Roles" tab and create a new machine-to-machine role with the permission of management API.
<img
alt="Create m2m management API role"
src={CreateM2mManagementApiRole}
width="600px"
style={{ borderRadius: '6px' }}
/>

<img
alt="Create m2m management API role"
src={CreateM2mManagementApiRole}
width="600px"
style={{ borderRadius: '6px' }}
/>
And then go to the "Roles" tab under machine to machine app detail page, and assign the role you just created to the app.

And then go to the "Roles" tab under machine to machine app detail page, and assign the role you just created to the app.
{' '}

<img
alt="Assign m2m management API role to app"
src={AssignManagementApiRole}
width="600px"
style={{ borderRadius: '6px' }}
/>
<img
alt="Assign m2m management API role to app"
src={AssignManagementApiRole}
width="600px"
style={{ borderRadius: '6px' }}
/>

</Step>
</Steps>
Loading