Skip to content
purduehackersPublic

About

🪪 | The OpenID Connect identity provider behind Purdue Hackers applications.

Resources

Stars

6 stars

Watchers

3 watching

Forks

Repository files navigation

🦑 squid

The new Purdue Hackers ID, an OIDC provider that other apps can sign in.

Setup

You can run and build with Deno:

cp .env.example .env

deno install
deno task db:push
deno task dev

Usage

To create a client that uses ID as a way of logging in, first go to ID's dashboard and create an application. There, you will input your application's name, scopes and redirect url.

In turn, you will receive a client id to use it in whatever client you are using. Even if you are not using external dependencies, it is also fairly easy to setup. This is an example with BetterAuth in a Svelte website:

// auth.ts
import { betterAuth } from 'better-auth';
import { genericOAuth } from 'better-auth/plugins/generic-oauth';

export const auth = betterAuth({
	database: /* yours */,
	plugins: [
		genericOAuth({
			config: [
				{
					providerId: 'purduehackers',
					clientId: 'my-app',
					discoveryUrl: 'https://id.purduehackers.com/api/auth/.well-known/openid-configuration',
					scopes: ['openid', 'profile', 'email'],
					pkce: true
				}
			]
		})
	]
});
// anywhere on the client
await authClient.signIn.social({ provider: 'purduehackers', callbackURL: '/' });

There's another example in examples/demo-client that doesn't rely on external dependencies, although it is significantly larger (200+ LOC) than this.

MCP server

ID has a remote MCP server at https://id.purduehackers.com/mcp.

claude mcp add --transport http purduehackers https://id.purduehackers.com/mcp

Access tokens must have the audience https://id.purduehackers.com/mcp.

Migration 0006_directory_github_scope.sql extends the existing directory resource's allowed scopes without changing client grants. New resource setup and the application/admin scope selectors use the shared DIRECTORY_SCOPES catalog.

About

🪪 | The OpenID Connect identity provider behind Purdue Hackers applications.

Resources

Stars

6 stars

Watchers

3 watching

Forks

Used by

Contributors

Languages