Skip to content

Instantly share code, notes, and snippets.

@ikovic
ikovic / CHANGELOG.md
Created November 15, 2023 09:37
SlashID updates - 3.1.0. -> 3.15.0

@slashid/slashid

3.15.0

Minor Changes

  • 25e6cd620: Add support for SAML authentication factor

Patch Changes

@ikovic
ikovic / index.jsx
Last active July 14, 2023 13:56
React SDK: <DynamicFlow>
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: {
@ikovic
ikovic / login.tsx
Last active May 17, 2023 14:42
Server side auth with Remix
// 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);
@ikovic
ikovic / index.html
Created April 8, 2023 08:37
Kakaku /id integration example
<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();

Keybase proof

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: