Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SEC-1493: Added CredentialsContainer interface and implemented it in …
…User, AbstractAuthenticationToken and UsernamePasswordAuthenticationToken. ProviderManager makes use of this to erase the credentials of the returned Authentication object (and its contents) if configured to do so by setting the 'eraseCredentialsAfterAuthentication' property.
- Loading branch information
Showing
7 changed files
with
113 additions
and
18 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
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
17 changes: 17 additions & 0 deletions
17
core/src/main/java/org/springframework/security/core/CredentialsContainer.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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.springframework.security.core; | ||
|
||
/** | ||
* Indicates that the implementing object contains sensitive data, which can be erased using the | ||
* {@code eraseCredentials} method. Implementations are expected to invoke the method on any internal objects | ||
* which may also implement this interface. | ||
* <p> | ||
* For internal framework use only. Users who are writing their own {@code AuthenticationProvider} implementations | ||
* should create and return an appropriate {@code Authentication} object there, minus any sensitive data, | ||
* rather than using this interface. | ||
* | ||
* @author Luke Taylor | ||
* @since 3.0.3 | ||
*/ | ||
public interface CredentialsContainer { | ||
void eraseCredentials(); | ||
} |
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