stocky-flower-23436
11/03/2023, 8:50 AMchilly-king-10285
11/03/2023, 8:50 AMchilly-king-10285
11/03/2023, 8:52 AMmkdir your-project cd your-project touch main.go handler.go middleware.go index.html go mod init <http://github.com/<your-name>/your-project|github.com/<your-name>/your-project>
- Install the Ory SDK which allows you to interact with Ory APIs: go get -u <http://github.com/ory/client-go|github.com/ory/client-go>
- You can find more details [here](https://www.ory.sh/docs/getting-started/integrate-auth/go). 2. Integrate authentication into your React application: - Create a new React project: npx create-react-app my_project --template typescript cd my_project
- Install the Ory SDK: npm i --save @ory/client
- You can find more details [here](https://www.ory.sh/docs/getting-started/integrate-auth/react). 3. Set up Ory Network: - Set up the Ory SDK URL which you can find in the [Ory Console](https://console.ory.sh/projects/current/developers/guides) export ORY_SDK_URL=https://{project.slug}.<http://projects.oryapis.com|projects.oryapis.com>
- Start the Ory Tunnel: npx @ory/cli tunnel --dev <http://localhost:3000>
- You can find more details [here](https://www.ory.sh/docs/getting-started/integrate-auth/react). 4. Go to production: - To connect the application to your Ory project, the app and Ory APIs must be available under the same common domain, for example <https://ory.example.com>
and <https://www.example.com>
. - Add a Custom Domain to your Ory Network project. - Use the configured custom domain in your SDK calls: // For Go c := ory.NewConfiguration() c.Servers = ory.ServerConfigurations{{URL: "<https://ory.example.org>"}} // For React var sdk = require("@ory/client") var ory = new sdk.FrontendApi( new sdk.Configuration({ basePath: "<https://ory.example.org>", baseOptions: { // Ensures that cookies are included in CORS requests: withCredentials: true, }, }), )
- You can find more details [here](https://www.ory.sh/docs/getting-started/integrate-auth/go) and [here](https://www.ory.sh/docs/getting-started/integrate-auth/expressjs). Please note that all authentication requests should go through the backend, no direct request to Ory Network should be made by the client.stocky-flower-23436
11/03/2023, 8:57 AM