<@U04UQ68083H> where to get client_id for Oauth2
# ory-copilot
m
@chilly-king-10285 where to get client_id for Oauth2
c
A message from kapa.ai
The
client_id
for OAuth2 can be obtained when you create an OAuth2 client using the Ory CLI. Here is an example command to create an OAuth2 client:
Copy code
bash ory create oauth2-client --project "$project_id" \    --name "Ory Docs OAuth2 Integration Example Client" \    --grant-type authorization_code,refresh_token,client_credentials \    --response-type code \    --scope openid --scope offline_access --scope email \    --redirect-uri <http://localhost:3000/callback>
After running this command, you will receive an output that includes the
client_id
. You can then set this
client_id
as an environment variable:
Copy code
bash export OAUTH_CLIENT_ID="{set to the client ID from output}"
You can also retrieve the details of an existing OAuth2 client, including its
client_id
, using the
get
command:
Copy code
bash ory get oauth2-client <id-1> [<id-2> ...] [flags]
Please replace
<id-1>
with the ID of your OAuth2 client. For more details, please refer to the [Ory documentation](https://www.ory.sh/docs/getting-started/oauth2-openid/add-oauth2-openid-connect-nodejs-expressjs#prerequisites).
m
is it possible to do in the dashboard?
s
In Ory Network dashboard, yes. Under OAuth2 > OAuth2 Clients > Create OAuth2 Client
m
already found it thank you