简体   繁体   English

Grails:spring-security-facebook插件和登录页面集成

[英]Grails: spring-security-facebook plugin and login page integration

I have been trying out the spring-security-facebook plugin and so far its been smooth. 我一直在尝试spring-security-facebook插件,到目前为止,它很顺利。 I am able to use the facebook login button and have also created the FacebookAuthService for some custom processing - in creating my own user object and associating it with the facebook domain object. 我能够使用facebook登录按钮,并且还创建了FacebookAuthService进行一些自定义处理-创建我自己的用户对象并将其与facebook域对象相关联。

However, what I want to do is integrate the button with the auth.gsp provided by spring-ui. 但是,我要做的是将按钮与spring-ui提供的auth.gsp集成在一起。 I was able to take the first step in this and the button now appears along with the regular login form. 我能够迈出第一步,现在该按钮与常规登录表单一起出现。 However, on clicking on the FB login button, I want the workflow to be the same as that of the regular spring flow. 但是,在单击FB登录按钮时,我希望工作流程与常规spring流程相同。

Are there any pointers for this? 是否有任何指示?

I assume I will need to stop using the facebookAuth:connect tag and instead build this part of the flow using javascript - but how do I get the logged in user now connected to spring so that on clicking the FB button, the page then goes to the page that I was earlier trying to access before spring security redirected me to the auth page? 我假设我将需要停止使用facebookAuth:connect标记,而是使用javascript构建流程的这一部分-但是如何使已登录的用户现在连接到spring,以便在单击FB按钮时转到该页面。在Spring Security将我重定向到auth页面之前,我曾尝试访问的页面?

Any directions for this would be much appreciated, thanks. 任何方向对此将不胜感激,谢谢。

Spring-Security-Facebok plugin uses cookies provided by Facebook (set by JS SDK after auth). Spring-Security-Facebok插件使用Facebook提供的cookie(在身份验证后由JS SDK设置)。 I mean there is two steps: first step is when user is logged into app on client side (done by javascript), and second when page is reloaded and server login user on server side too. 我的意思是有两个步骤:第一步是当用户在客户端登录到应用程序时(通过javascript完成),第二步是重新加载页面并且服务器端也登录了服务器登录用户。

Probably you can make your own Javascript event listener on 'auth.login' , and redirect to requred page. 可能您可以在'auth.login'上创建自己的Javascript事件侦听器 ,然后重定向到所需的页面。 User will be authenticated at this point. 此时将对用户进行身份验证。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM