Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make an expired cookie #177

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Make an expired cookie #177

wants to merge 1 commit into from

Conversation

rtyley
Copy link
Member

@rtyley rtyley commented Dec 10, 2024

No description provided.

.withCredentials(new ProfileCredentialsProvider("workflow")).build()

val signingAndVerification: SigningAndVerification =
PanDomainAuthSettingsRefresher("gutools.co.uk", "testing",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Joe, make sure you match gutools.co.uk to the domain you got your cookie from, eg it may need to be code.dev-gutools.co.uk

class PanDomainAuthSettingsRefresherTest extends AnyFreeSpec with Matchers with EitherValues with OptionValues {

"Give an expired cookie" in {
val myRealCookie = ""// "Paste in your real cookie value here - from the 'gutoolsAuth-assym' cookie"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get this from a browser session on a real gutools site.

val user: AuthenticatedUser = CookieUtils.parseCookieData(myRealCookie, signingAndVerification).value
val expiredUser = user.copy(expires = Instant.now.minus(48, HOURS).toEpochMilli)
val expiredCookieText = CookieUtils.generateCookieData(expiredUser, signingAndVerification)
println(expiredCookieText)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expired cookie output here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant