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

Add okta bypass #21

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Add okta bypass #21

wants to merge 2 commits into from

Conversation

jackcrane
Copy link
Collaborator

@jackcrane jackcrane commented Mar 17, 2025

This PR, once merged, will allow devs to bypass the okta login process and be able to generate auth tokens from the command line.

Functionality is not added, this just reduces the number of steps to get logged in.

Usage

You can use this utility by running

$ yarn okta

from your /api directory. It will query the db for users, allow you to pick one, then it will generate a JWT for them that you can add to the application's localStorage. It provides a cmdlet that you can put directly in the browser's console. Navigate to slu open project (localhost:5173 most likely), open the console ("Cmd + Option + J" (on a Mac) or "Ctrl +Shift +J" (on Windows)) and paste in the line of code the cmdlet provides you (starting with localStorage.setItem... and ending with .reload().

@jackcrane ➜ /workspaces/open-project/api (add-okta-bypass) $ yarn okta
yarn run v1.22.22
$ node util/generateToken.js
✔ Select a user to generate a token for Jack Crane (cm2ceomc20000qrdmvld5p3s6)
Paste the following into your browser's console to set the token and log in as Jack Crane:

localStorage.setItem("token", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImNtMmNlb21jMjAwMDBxcmRtdmxkNXAzczYiLCJlbWFpbCI6ImphY2suY3JhbmVAc2x1LmVkdSIsImZpcnN0TmFtZSI6IkphY2siLCJsYXN0TmFtZSI6IkNyYW5lIiwiaWF0IjoxNzQyMjM3NzAzLCJleHAiOjE3NDIzMjQxMDN9.53Ct7tQp-6PJ8QyhF5TeOq93qFS-ON-_IsqdT0fmULw");document.location.reload()

You will be logged in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant