में सोशल मीडिया लॉगिन का कार्यान्वयन मैं वसंत 3 और वसंत सुरक्षा का उपयोग कर रहा हूं। उदाहरण के लिए मैं सामाजिक खातों को एकीकृत कर रहा हूं: फेसबुक, ट्विटर और Google। मैं जावास्क्रिप्ट एसडीके संस्करण का उपयोग कर रहा हूं लेकिन मेरी समस्या यह है कि मैं एक उपयोगकर्ता को पंजीकृत कर सकता हूं लेकिन मुझे यकीन नहीं है कि उन्हें प्रमाणित कैसे किया जाए।वसंत सुरक्षा
उदाहरण के लिए:
उपयोगकर्ता लिंक (फेसबुक, ट्विटर, गूगल) नया संवाद बॉक्स खोला के बाद प्रमाणित है सफलतापूर्वक मैं उनकी बुनियादी प्रोफ़ाइल विवरण प्राप्त कर सकते हैं में से किसी पर क्लिक किया जब: ईमेल, आईडी, नाम, छवियों और मैंने यह सारी जानकारी AJA का उपयोग करके मेरे नियंत्रक को पास कर दी है, जो उपयोगकर्ता को पहले से पंजीकृत नहीं होने पर उपयोगकर्ता को सहेजने के लिए कॉल सेवा और दाओ को कॉल करता है।
यहां तक कि सबकुछ मेरे लिए ठीक काम कर रहा है। मैंने उपयोगकर्ता आईडी का उपयोग किया और उन्हें नमक का उपयोग करके एन्क्रिप्ट किया और इसे पासवर्ड के रूप में डेटाबेस में सहेज लिया (मुझे यकीन नहीं है कि यह इससे निपटने का सही तरीका है या नहीं) लेकिन अब मेरा भ्रम यह है कि मैं उपयोगकर्ता को प्रमाणित कैसे कर सकता हूं और उन्हें अनुमति देता हूं सिस्टम में लॉगिन करने के लिए।
मेरे security.xml फ़ाइल
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans" xmlns="http://www.springframework.org/schema/security"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.2.xsd">
<!-- Configuration for master level user login -->
<http auto-config="true" use-expressions="true"
disable-url-rewriting="true">
<!-- <csrf /> -->
<headers>
<cache-control />
<content-type-options />
<hsts />
<frame-options />
<xss-protection />
</headers>
<!-- requires-channel="https" -->
<intercept-url pattern="/favicon.ico" access="permitAll" />
<intercept-url pattern="/login*" access="permitAll" />
<intercept-url pattern="/login/facebook-login*" access="permitAll" />
<intercept-url pattern="/validateUserCredentials*"
access="permitAll" />
<intercept-url pattern="/register*" access="permitAll" />
<intercept-url pattern="/activation*" access="permitAll" />
<intercept-url pattern="/restore*" access="permitAll" />
<intercept-url pattern="/resend*" access="permitAll" />
<intercept-url pattern="/resources/**" access="permitAll" />
<intercept-url pattern="/license*"
access="hasAnyRole('${role.admin}', '${role.master}')" />
<intercept-url pattern="/**"
access="hasAnyRole('${role.admin}', '${role.master}', '${role.owner}', '${role.simple}')" />
<access-denied-handler error-page="/denied" />
<form-login login-page="/login" default-target-url="/logged"
authentication-failure-url="/loginfailed" login-processing-url="/j_spring_security_check" />
<logout logout-success-url="/login" invalidate-session="true"
delete-cookies="JSESSIONID,SPRING_SECURITY_REMEMBER_ME_COOKIE" />
<session-management session-fixation-protection="migrateSession">
<concurrency-control error-if-maximum-exceeded="true"
max-sessions="1" expired-url="/login" />
</session-management>
<remember-me token-validity-seconds="86400" />
</http>
<authentication-manager alias="authenticationManager">
<authentication-provider ref="daoAuthenticationProvider" />
</authentication-manager>
<beans:bean id="daoAuthenticationProvider"
class="org.springframework.security.authentication.dao.DaoAuthenticationProvider">
<beans:property name="userDetailsService" ref="userDetailsService" />
<beans:property name="saltSource" ref="saltSource" />
<beans:property name="passwordEncoder" ref="passwordEncoder" />
</beans:bean>
<beans:bean id="passwordEncoder"
class="org.springframework.security.authentication.encoding.ShaPasswordEncoder" />
<beans:bean id="saltSource"
class="org.springframework.security.authentication.dao.ReflectionSaltSource">
<beans:property name="userPropertyToUse" value="salt" />
</beans:bean>
<beans:bean id="userDetailsService" name="userAuthenticationProvider"
class="com.luffy.security.AuthenticationUserDetailService">
</beans:bean>
</beans:beans>
किसी भी मदद की सराहना की जाएगी। मैंने इस मुद्दे को हल करने के लिए जो कुछ भी किया है, मैंने किया लेकिन मैं किसी भी विश्वसनीय समाधान को समझने में सक्षम नहीं हूं।
जवाब मैं लंबे समय से कुछ इस तरह के लिए देख रहा था लेकिन मैं अभी भी जो कर रहा है जब मैं अमेरिकन प्लान से उपयोगकर्ता को प्रमाणित अपने समाधान के साथ एक समस्या है के लिए धन्यवाद वसंत में मैं उसी उपयोगकर्ता को प्रमाणीकृत और अधिकृत कैसे कर सकता हूं ताकि वसंत उपयोगकर्ता को मान्य कर सके। क्षमा करें अगर आपको यह बेवकूफ लगता है तो मैं कुछ समय से इस पर अटक गया हूं – Luffy
Ive कस्टम कार्यान्वयन जोड़ा? आशा करता हूँ की ये काम करेगा। कस्टम प्रमाणीकरण को संभालने के लिए वसंत पक्ष में कॉन्फ़िगरेशन की थोड़ी सी आवश्यकता होती है। –