azuread securecookie: the value is too long
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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