orange-guitar-65918
03/07/2024, 11:28 AMchilly-king-10285
03/07/2024, 11:28 AMchilly-king-10285
03/07/2024, 11:28 AMbash export ORY_SDK_URL=<http://localhost:4433>
2. Start the React development server: bash npm run start
3. Then open <http://localhost:3000>
in your browser. After loading, you will be presented with Ory's Sign In page. Click on sign up and create your first user. You can find more details in the [Ory documentation](https://www.ory.sh/docs/getting-started/integrate-auth/react#run-your-react-app). If you're still having trouble, make sure your client ID and client secret are correct. You can check your registered clients with the following command: bash hydra list clients --endpoint <http://127.0.0.1:4445>
If you see an error message like Error: invalid_client Description: Client authentication failed (for example, unknown client, no client authentication included, or unsupported authentication method) Hint: The requested OAuth 2.0 Client doesn't exist.
, it means that your client ID or client secret might be incorrect. You can find more details in the [Ory documentation](https://www.ory.sh/docs/hydra/self-hosted/gitlab#client-wrong). If you're trying to register an OAuth2 and OpenID Connect client, you can use the SDK or REST API. Here's a sample code on how to do it: javascript import { Configuration, OidcApi } from "@ory/client" const ory = new OidcApi( new Configuration({ basePath: `https://${process.env.ORY_PROJECT_SLUG}.<http://projects.oryapis.com|projects.oryapis.com>`, accessToken: process.env.ORY_API_KEY, }), ) export async function createOidcDynamicClient() { const { data } = await ory.createOidcDynamicClient({ oAuth2Client: { grant_types: ["authorization_code", "refresh_token"], redirect_uris: ["<https://example.com>"], scope: "offline openid", token_endpoint_auth_method: "client_secret_post", }, }) console.log(data.registration_access_token) // Write this down, it is only sent once! console.log(data.client_id, data.client_secret /* ... */) }
You can find more details in the [Ory documentation](https://www.ory.sh/docs/hydra/guides/oauth2-clients#register-oauth2-and-openid-connect-clients).