How to do stateless (session-less) & cookie-less authentication?

Ah, I love these questions – maintaining a session without a session. I’ve seen multiple ways to do this during my stints during application assessments. One of the popular ways is the playing tennis way that you mentioned – sending the username and password in every request to authenticate the user. This, in my opinion, … Read more

How to manually set an authenticated user in Spring Security / SpringMVC

I couldn’t find any other full solutions so I thought I would post mine. This may be a bit of a hack, but it resolved the issue to the above problem: public void login(HttpServletRequest request, String userName, String password) { UsernamePasswordAuthenticationToken authRequest = new UsernamePasswordAuthenticationToken(userName, password); // Authenticate the user Authentication authentication = authenticationManager.authenticate(authRequest); SecurityContext … Read more

Swift add icon/image in UITextField

Sahil has a great answer and I wanted to take that and expand it into an @IBDesignable so developers can add images to their UITextFields on the Storyboard. Swift 4.2 import UIKit @IBDesignable class DesignableUITextField: UITextField { // Provides left padding for images override func leftViewRect(forBounds bounds: CGRect) -> CGRect { var textRect = super.leftViewRect(forBounds: … Read more