I am building a first party mobile application that authenticates via a Spring Boot backend server (acting as the authentication and the resource server). I planned to use Spring Authorization Server to handle logging into the mobile application via username/password, as well as other OAuth providers (e.g. Login with Google).
I had a similar use case on a different project and used Spring Security OAuth with client_credentials
and password
grant types to authenticate via username/password.
In reviewing this feature matrix, it appears Spring Authorization Server will not support the password grant type.
Confirmed here with multiple confused emoji reactions, and I am also confused :)
The resource owner password grant type seems like a valid use case for first-party mobile applications. What is the recommended way to authenticate first-party mobile applications with Spring Authorization Server?
If the authorization_code
grant should be used instead per the OAuth 2.1 spec, how do I submit the username/password from the native mobile application instead of using the form login provided by Spring Authorization Server?
@Bean
SecurityFilterChain defaultSecurityFilterChain(HttpSecurity http) throws Exception {
http
.authorizeHttpRequests(authorize ->
authorize.anyRequest().authenticated()
)
.formLogin(withDefaults());
return http.build();
}