Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
153 views
in Technique[技术] by (71.8m points)

java - how to call methods of GWT with Http connection?

I'm struggling with GWT in order to make SSO connection when you login a portal site, I want to automatically login into the program I have. but I don't have any idea since GWT is made base on components in java code. so, It doesn't have controllers and no addresses for specific pages. all about things are with event methods.

SSO_index.jsp

<%
  response.sendRedirect("/main");
%>

Main.java

onModuleLoad(){
 ... 
 LoginServiceManager.get(mainEventBus).openLoginPopUp();
}

LoginServiceManager.java

openLoginPopUp(){
  callLoginService(...);
}
(several methods)

for example,

At SSO_index.jsp, How can I call service(Impl) like the class of callLoginService() or LoginServiceManager.openLoginPopUp() routine...

I don't have any information with this. no book, no specialist, no data on google. so, don't be harsh on me. otherwise, I wouldn't have asked this here. I don't know how to approach, access from jsp to java(not original java code but GWT code) methods since I don't have views with html or jsp... something like that.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

SSO is an authentication scheme that allows a user to log in with a single ID and password to any of several related, yet independent, software systems. It is also independent of the technologies used.

Do you already have authentication on your GWT application and you want to integrate it with some SSO server? Please find, on the GWT server side, the code that implements authentication. There instead of using, for example, a local database to check a user/password, connect to the SSO server to check if the user already has a session, or if a login is needed. Otherwise, no other changes to the GWT application should be needed.

That said, implementing SSO in a GWT application is not different from implementing SSO in a Java server application. You can achieve this by having all your log-ins happen on the authentication server. The other applications can communicate with the authentication server. Try using an existing implementation, as writing one will be hard. For instance, have a look at this tutorial: https://www.baeldung.com/sso-spring-security-oauth2.

You then mention JSP - JavaServer Pages - which is not related to GWT. Is GWT and JSP somehow mixed together in that application? Would you please clarify?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...