markbates / markbates/goth

azuread securecookie: the value is too long

Open
#463 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
6.6k
Forks
631
PR merge metrics
No merged PRs in 30d

Description

Hi,

I cannot get azuread oauth working with goth. Has anyone managed to use azuread/azuread2?
The error:

> securecookie: the value is too long

Google sign in works fine.

The issue is with the size of the cookie being set in the browser.

I've tried using a postgresql session store.
```
store, err := pgstore.NewPGStore("postgres://postgres:postgres@"+os.Getenv("db_uri")+"/db?sslmode=disable", []byte(os.Getenv("SESSION_SECRET")))
if err != nil {
log.Fatalf(err.Error())
}
defer store.Close()
defer store.StopCleanup(store.Cleanup(time.Minute * 5))
gothic.Store = store // Appears to have no effect
```
This creates the session table but goth doesn't populate rows even on successful google sign ins.
I do not need the access token from the sign in. Only the verified email address.

Other issues mention removing claims/groups. This is with a new azure project with no modifications.

Thanks,
Simon

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how goth/gothic.Store and the pgstore session store are used during Azure AD and Google sign-in, then compare the cookie data that reaches securecookie. Reproduce the Azure AD flow and inspect whether the session table is populated. Done means Azure AD sign-in can complete without an oversized cookie while retaining the verified email address.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, go, postgresql
Domain
authentication, backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.