Skip to content

feat: add spa support for CSRF by setting into cookie - #129

Open
svenzik wants to merge 1 commit into
mainfrom
WE2-1240
Open

feat: add spa support for CSRF by setting into cookie#129
svenzik wants to merge 1 commit into
mainfrom
WE2-1240

Conversation

@svenzik

@svenzik svenzik commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

add spa support for CSRF by setting into cookie

Signed-off-by: Sven Mitt svenzik@users.noreply.github.com

Comment thread example/src/main/java/eu/webeid/example/config/ApplicationConfiguration.java Outdated
WE2-1240

Signed-off-by: Sven Mitt <svenzik@users.noreply.github.com>
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins(config.getCorsAllowedOrigin())

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As discussed, let's reuse local-origin and get rid of corsAllowedOrigin:

Suggested change
.allowedOrigins(config.getCorsAllowedOrigin())
.allowedOrigins(config.getLocalOrigin()())

@svenzik svenzik Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately, it is not that easy.
Property file contains only local-origin property, but...

When allowing http in Web-eID WebExtension, web-eid app still signs nonce using https protocol (https://localhost:3000), even though developer is using http://localhost:3000 in browser address bar.

in backend, local-origin needs to be https://localhost:3000 during validation (or it fails), but cors needs to be http://localhost:3000, or it fails

We can either change web-eid app to sign http://localhost:3000 or separate local-origin and cors-allowed-origin for above mentioned web-eid app issue

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.

2 participants