Comments (6)
Chris,
There is some code to save the original url and redirect the user back to it after login. The SecureSocial.checkAccess() method saves it. It does it for GET requests, for POST requests it just redirects to /. Do you see it fail for GET requests?
Jorge
from securesocial.
Hi Jorge,
Sorry I should have mentioned that I'm still using a customised secure module at the moment but I would like to move to using SecureSocial, however from looking at the source the same issue exists in both for this use case. I have a login link in my app that is available on pages that can be viewed by both signed-in and unsigned-in users and as a result the class is not annotated with "@with(...)". When selected the login link calls the login() controller method to render the login page but checkAccess() method is not called so the originalUrl is not defined and in this case I would like the originalUrl to be set to the referer header when the originalUrl is not already defined, e.g.
/**
- The action for the login page.
*/
public static void login() {
final Collection providers = ProviderRegistry.all();
String originalURL = flash.get(ORIGINAL_URL);
if (originalURL == null) {
Http.Header refererHeader = request.headers.get("referer");
if (refererHeader != null && refererHeader.values.size() > 0) {
flash.put(ORIGINAL_URL, refererHeader.values.get(0));
}
} else {
flash.keep(ORIGINAL_URL);
}
boolean userPassEnabled = ProviderRegistry.get(ProviderType.userpass) != null;
render(providers, userPassEnabled);
}
This is obviously a customisation that not everyone wants so I was looking for a mechanism to add optionally add this.
Chris
from securesocial.
Are you pointing to the login page from the public pages?
from securesocial.
Yes I have a login link in the top right of my pages. This link changes to logout after a user has authenticated and points to the logout page. Similar to the login when the user selects logout they are returned to the same page, but with less content. I forked SecureSocial and added two callback methods to UserService, onLogin and onLogout. The idea would be that onLogin could set the originalUrl to the referrer if originalUrl was not already set and onLogout could set the redirectTo to the referrer to display the page prior to selecting logout. Implementing the callbacks would allow my app to customise the authentication process without impacting too much on the framework itself and affecting other users of the module. Thoughts?
from securesocial.
You can use securesocial.login.redirect=MyController.myAction in application.conf to specify the page you'd like to user to be redirected after log in if no originalURL was detected.
from securesocial.
I cannot find the checkAccess method in the code. Has it been removed? Otherwise, please tell me the file in which it lives.
Thanks
from securesocial.
Related Issues (20)
- Build breaks after new release. HOT 3
- Security: password reset email host injection HOT 2
- v3.0-M7 play2.5 HOT 4
- Facebook oauth token format change causes error (suspected) HOT 3
- Getting weird issue with email sending
- Inconsistent error from Facebook Sign-in
- Ready-made Backend
- compatible HOT 2
- Control the number of rest API calls with securesocial HOT 1
- Support Play 2.6 HOT 2
- scala 2.12 HOT 1
- After hitting the /logout api, Session is not getting cleared it is only redirecting to login_page. And i am able to login again with the same token id HOT 1
- Add cookie SameSite HOT 1
- Can't use with Scala 2.12 HOT 4
- Ambiguous implicit values HOT 1
- Action Not Found For request 'GET /authenticate/github? HOT 1
- Documentation has not been update for play 2.6
- push secure social jar with support for play 2.6 to maven
- NoSuchFieldError: state (facebook provider error) HOT 1
- Looking for a maintainer?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from securesocial.