Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Error code 403 by Database authentication(Scout 11)
Error code 403 by Database authentication [message #1853638] Tue, 12 July 2022 07:18 Go to next message
Felix R is currently offline Felix RFriend
Messages: 22
Registered: January 2015
Junior Member
Hi,
I have implemented Database authentication (source code s. below)
I get the exception "Service tunnel request failed with status code 403"

2022-07-12 08:55:37,751 WARN [qtp505021446-50] org.eclipse.scout.rt.shared.servicetunnel.AbstractServiceTunnel.interceptRequest(AbstractServiceTunnel.java:84) - No UserAgent set on calling context; include default in service-request - MDC[]
2022-07-12 08:55:37,773 WARN [qtp505021446-50] org.eclipse.jetty.server.HttpChannel.handleException(HttpChannel.java:806) - /auth - MDC[]
org.eclipse.scout.rt.shared.servicetunnel.http.HttpServiceTunnelException: Service tunnel request failed with status code 403 [remote-service.name=org.eclipse.scout.apps.helloscout.shared.security.ISqlAuthService, remote-service.operation=verify]
at org.eclipse.scout.rt.shared.servicetunnel.http.RemoteServiceInvocationCallable.call(RemoteServiceInvocationCallable.java:83)

the solution from
https://stackoverflow.com/questions/40914718/eclipse-scout-clean-database-authentication
and from
https://www.eclipse.org/forums/index.php/m/1805911/?srch=UiServletFilter#msg_1805911
doesnt work

Source code:

in ui.html module:

UiServletFilter.init
m_formBasedAccessController = BEANS.get(FormBasedAccessController.class).init(new FormBasedAuthConfig()
.withCredentialVerifier(BEANS.get(DataSourceCredentialVerifier.class)));

public class DataSourceCredentialVerifier implements ICredentialVerifier {
private static final Logger LOG = LoggerFactory.getLogger(DataSourceCredentialVerifier.class);

@Override
public int verify(String username, char[] password) throws IOException {
LOG.debug("verify in DataSourceCredentialVerifier. User " + username);
Subject subject = new Subject();
subject.getPrincipals().add(new SimplePrincipal("system"));
subject.setReadOnly();

RunContext runContext = RunContexts.empty();

int result = runContext.call(new Callable<Integer>() {
@Override
public Integer call() throws Exception {
ISqlAuthService service = BEANS.get(ISqlAuthService.class);
int res = service.verify(username, password); // hier exception: Service tunnel request failed with status code 403
return res;
}
});
return AUTH_OK;
}

in shared module:
@TunnelToServer
public interface ISqlAuthService extends IService {
int verify(String username, char[] password);
}

in server module:
public class SqlAuthService implements ISqlAuthService {

@Override
public int verify(String username, char[] password) {

// verifie the user in the database
int result = ICredentialVerifier.AUTH_OK;
return result;
}

Could you please help me

Thank you
Felix
Re: Error code 403 by Database authentication [message #1853662 is a reply to message #1853638] Wed, 13 July 2022 05:38 Go to previous message
Felix R is currently offline Felix RFriend
Messages: 22
Registered: January 2015
Junior Member
I've changed the runcontext:
RunContext runContext = RunContexts.copyCurrent(true).withSubject(subject).withLocale(Locale.GERMAN);
and it works now
Previous Topic:Load Balancing
Next Topic:Core Exception in pom.xml files
Goto Forum:
  


Current Time: Sun Mar 03 10:46:44 GMT 2024

Powered by FUDForum. Page generated in 0.03025 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top