Skip to content

Instantly share code, notes, and snippets.

View mayur-raval's full-sized avatar
🏠
Working from home

Mayur Raval mayur-raval

🏠
Working from home
View GitHub Profile
@alexramos1
alexramos1 / CognitoAuthenticationProvider.java
Last active July 30, 2023 07:44
Simplest possible implementation of AWS Cognito username/password authentication on Spring Security.
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Base64;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Nonnull;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
@bvulaj
bvulaj / SecurityConfiguration.java
Last active December 15, 2020 16:38
Multiple Oauth2 Providers in Spring Security
@Autowired
private FacebookPrincipalExtractor facebookPrincipalExtractor;
@Autowired
private FacebookAuthoritiesExtractor facebookAuthoritiesExtractor;
@Autowired
private GooglePrincipalExtractor googlePrincipalExtractor;
@Autowired
private GoogleAuthoritiesExtractor googleAuthoritiesExtractor;
@Bean