mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-13 14:12:11 +00:00
added anonymous and bearer filter from 4709
This commit is contained in:
1 parent
cb63abf0c2
commit
ca0b656a50
2 files changed
+27
No files matched your search
@@ -55,6 +55,10 @@ authc.successUrl = /api/restsecurity/hello
|
||||
# authentication with POST parameters "username" and "password".
|
||||
bearerToken = com.sap.sailing.server.security.BearerTokenOrBasicOrFormAuthenticationFilterSAPSailing
|
||||
|
||||
# The same as bearerToken, but with additional fallback to anonymous authentification.
|
||||
# In this case sufficent permission checks have to be done on the application side.
|
||||
bearerTokenOrAnonymous = com.sap.sailing.server.security.BearerTokenOrBasicOrFormOrAnonymousAuthenticationFilterSAPSailing
|
||||
|
||||
# Specifying filter chains for URL patterns
|
||||
|
||||
[urls]
|
||||
@@ -74,6 +78,7 @@ bearerToken = com.sap.sailing.server.security.BearerTokenOrBasicOrFormAuthentica
|
||||
/api/v1/regattas/*/competitors/*/add = bearerToken
|
||||
/api/v1/regattas/*/competitors/*/remove = bearerToken
|
||||
/api/v1/regattas/*/competitors/createandadd = bearerToken
|
||||
/api/v1/leaderboardgroups* = bearerTokenOrAnonymous
|
||||
|
||||
# Secure the access (in particular the POST/write access) to posting race log events
|
||||
/rc/racelog = bearerToken
|
||||
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.sap.sailing.server.security;
|
||||
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
|
||||
import com.sap.sse.ServerStartupConstants;
|
||||
import com.sap.sse.security.BearerTokenOrBasicOrFormAuthenticationFilter;
|
||||
|
||||
public class BearerTokenOrBasicOrFormOrAnonymousAuthenticationFilterSAPSailing
|
||||
extends BearerTokenOrBasicOrFormAuthenticationFilter {
|
||||
|
||||
public BearerTokenOrBasicOrFormOrAnonymousAuthenticationFilterSAPSailing() {
|
||||
super("SAP Sailing Analytics (" + /* application name */ ServerStartupConstants.SERVER_NAME + ")");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean onAccessDenied(ServletRequest request, ServletResponse response) throws Exception {
|
||||
super.onAccessDenied(request, response);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user