- 25e6cd620: Add support for SAML authentication factor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { SlashIDProvider, DynamicFlow } from "@slashid/react"; // available from 1.6.4. | |
// first define a function that takes an email and returns a Factor | |
const getFactor = (email: string) => { | |
const domain = email.split("@")[1]; | |
if (domain === "<REPLACE WITH THE DOMAIN>") { | |
return { | |
method: "oidc", | |
options: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// login route action handler receives the token as form data and persists it as a cookie | |
export async function action({ request }: ActionArgs) { | |
const formData = await request.formData(); | |
const token = formData.get("token") as string; | |
const redirectTo = getRedirectToFromForm(formData); | |
if (!token) return handleFailure(request); | |
await handleSignInSuccess(token); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="module"> | |
// alternatively include the script in whatever way is convenient | |
import { SlashID } from "@slashid/slashid"; | |
addEventListener("load", async (event) => { | |
const sid = new SlashID() | |
const ATTRIBUTE_KAKAKU_HANDLE = "@slashid/kakaku/LAST_HANDLE"; | |
const user = await sid.getUserFromURL() | |
const bucket = user.getBucket(); |
I hereby claim:
- I am ikovic on github.
- I am ikovic (https://keybase.io/ikovic) on keybase.
- I have a public key ASBHlZvo_jzEEzC9VLoqLK7zcdLC4Ob1dcLwEfJK1Dj3WQo
To claim this, I am signing this object: