How to force-login facebook session in spring social? - spring-social-facebook

How to force-login facebook session in spring social?
I have used oauth-type= reauthentication, parameter value to the oauth2parameters.

Related

Spring Boot Security Oauth2 - adding dynamic OIDC parameters

How do I add OIDC token request parameters dynamically in my app code? I want to add domain_hint based on some data received by my controller from as yet un-authenticated user.
You can implement custom OAuth2AuthorizationRequestResolver
and then add to your spring security configuration
.oauth2Login(req->
req.authorizationEndpoint()
.authorizationRequestResolver(new YourCustomAuthorizationRequestResolver)
)

spring-Security page redirect Issue

First of all am new to spring security.
my Question is when I authenticate a user from form and redirect to a url of controller handler method and get a view.Then after user click a link,Then how to authenticate that url and other particular user.
This thing I did in Session validation in every jsp normal java with out spring security.
How to achieve this in spring security.

Spring authorization without authentication

I am doing SAML based authentication in my application, and able to fetch the user role and id through SAML api, now How can I set this values for Spring role based authorization as my login module is not calling Spring form login,in that case how the AuthenticationManager fetch these values?

How to store values in session if cookie is disabled in spring MVC

I am using Spring MVC 3.1 and developing a web application.
I am storing loged in user name and password in session.since session is stored in cookie, once cookie is disabled I am not able to log in.
is there is any solution in SPRING MVC to store session other then cookie.
Thanks
You want to use URL rewriting to persist the JSESSIONID in the URL's across requests. You can configure the ServletContext to use the URL tracking mode (instead of COOKIE) as described here.
With Servlet 3.0 you do this:
<session-config>
<cookie-config>
<tracking-mode>URL</tracking-mode>
</cookie-config>
</session-config>
I noticed that in my application (Java EE 6, Spring MVC 3.2.4, Spring Security 3.1.4) JSTL's <c:url> tags start adding the sessionid value to each URL when cookies get disabled. Spring Security works normally. I did not have to do any configuration to achieve this.

Get Spring Principal User From HTTPSession From a Servlet

I have a web application that is using Spring 3.* and I have a Flash component inside my web application that needs to POST to a Servlet. Inside the Servlet's doPost method I want to check the Spring application context to ensure there is an authenticated session, is this possible?
Well it is very simple, just use
Authentication auth = SecurityContextHolder.getContext().getAuthentication();

Resources