GithubHelp home page GithubHelp logo

ankitr / next-authkit-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from workos/next-authkit-example

0.0 0.0 0.0 131 KB

Example application demonstrating how to authenticate users with AuthKit and the WorkOS Node SDK.

JavaScript 1.50% TypeScript 98.50%

next-authkit-example's Introduction

Next.js integration example using AuthKit

An example application demonstrating how to authenticate users with AuthKit and the WorkOS Node SDK.

Refer to the User Management documentation for reference.

Prerequisites

You will need a WorkOS account.

Running the example

  1. In the WorkOS dashboard, head to the Redirects tab and create a sign-in callback redirect for http://localhost:3000/callback.

  2. After creating the redirect URI, navigate to the API keys tab and copy the Client ID and the Secret Key. Rename the .env.local.example file to .env.local and supply your Client ID and API key as environment variables.

  3. Additionally, create a cookie password as the private key used to encrypt the session cookie. Copy the output into the environment variable WORKOS_COOKIE_PASSWORD.

    It has to be at least 32 characters long. You can use https://1password.com/password-generator/ to generate strong passwords.

  4. Verify your .env.local file has the following variables filled.

    WORKOS_CLIENT_ID=<YOUR_CLIENT_ID>
    WORKOS_API_KEY=<YOUR_API_SECRET_KEY>
    WORKOS_REDIRECT_URI=http://localhost:3000/callback
    WORKOS_COOKIE_PASSWORD=<YOUR_COOKIE_PASSWORD>
  5. Run the following command and navigate to http://localhost:3000.

    npm run dev

next-authkit-example's People

Contributors

andy-hook avatar benoitgrelard avatar paulasjes avatar kendallstrautman avatar ankitr avatar jlengstorf avatar jstrutz avatar pmarsceill avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.