Sign in with MLH
"Sign in with MLH" lets your application authenticate hackers with their My MLH account and, with the user's permission, read their profile. It's OAuth 2.0.
1. Register an application
On My MLH, create an application to get your credentials:
- Open OAuth applications and create a new one.
- Fill in:
- Name (e.g.
LoonHacks) - Logo (JPG, PNG, or GIF, up to 1 MB)
- Redirect URI(s) — where MLH sends users back after they authorize (e.g.
https://loonhacks.com/oauth/callback); you can list more than one.
- Name (e.g.
- Save. You'll get an Application ID (client ID) and a Client Secret — keep the secret private. You can reset the secret from the application page, and you'll see how many users have registered through your app.
2. Send users through OAuth
Use one of the standard OAuth 2.0 grants:
- Authorization code (recommended, for server-side apps) — redirect the user to
MLH's authorize endpoint, they approve, MLH redirects back with a
code, and you exchange it (with your client ID + secret) for an access token. - Implicit (for client-side / mobile) — the token is returned directly.
3. Scopes
Request only what you need. Some fields are always available; others require a scope the user consents to:
- Always available:
id,first_name,last_name,created_at,updated_at. - Optional scopes:
email,phone_number,demographics,birthday,education,event.
4. Read user data
GET /api/v3/user— the authenticated user's profile (via their access token).GET /api/v3/users— the users who registered through your application (paginated; available as JSON or CSV).
Libraries
omniauth-mlh(Ruby) — drop "Sign in with MLH" into a Rails/Rack app.
Related
- My MLH — the accounts you authenticate, and the connected apps users can revoke.
- V4 API — the broader MLH data platform API.