forked from spring-attic/spring-security-oauth
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix WWW-Authenticate challenge for form-based client authentication
The default AuthenticationEntryPoint for the client credentials token filter was returning "Basic" style headers on a 401. This change fixes the default to be the same as it was in XML (I believe).
- Loading branch information
Dave Syer
committed
Apr 14, 2015
1 parent
3a76715
commit bbd7b70
Showing
3 changed files
with
17 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 12 additions & 2 deletions
14
tests/annotation/form/src/test/java/demo/ResourceOwnerPasswordProviderTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,23 @@ | ||
package demo; | ||
|
||
import org.springframework.boot.test.SpringApplicationConfiguration; | ||
import org.springframework.security.oauth2.client.resource.BaseOAuth2ProtectedResourceDetails; | ||
import org.springframework.security.oauth2.client.test.BeforeOAuth2Context; | ||
import org.springframework.security.oauth2.common.AuthenticationScheme; | ||
|
||
import sparklr.common.AbstractResourceOwnerPasswordProviderTests; | ||
|
||
/** | ||
* @author Dave Syer | ||
*/ | ||
@SpringApplicationConfiguration(classes=Application.class) | ||
public class ResourceOwnerPasswordProviderTests extends AbstractResourceOwnerPasswordProviderTests { | ||
@SpringApplicationConfiguration(classes = Application.class) | ||
public class ResourceOwnerPasswordProviderTests extends | ||
AbstractResourceOwnerPasswordProviderTests { | ||
|
||
@BeforeOAuth2Context | ||
public void tweakClientAuthentication() { | ||
((BaseOAuth2ProtectedResourceDetails)context.getResource()) | ||
.setClientAuthenticationScheme(AuthenticationScheme.form); | ||
} | ||
|
||
} |