Skip to content

Commit 77e3f0d

Browse files
Add a warn log for AAD deprecated properties. (Azure#22565)
* * Add some warn log for deprecated properties.
1 parent d15aa17 commit 77e3f0d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

sdk/spring/azure-spring-boot/src/main/java/com/azure/spring/autoconfigure/aad/AADAuthenticationProperties.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import com.azure.spring.aad.AADAuthorizationGrantType;
77
import com.azure.spring.aad.webapp.AuthorizationClientProperties;
88
import com.nimbusds.jose.jwk.source.RemoteJWKSet;
9+
import org.apache.commons.logging.Log;
10+
import org.apache.commons.logging.LogFactory;
911
import org.springframework.beans.factory.InitializingBean;
1012
import org.springframework.boot.context.properties.ConfigurationProperties;
1113
import org.springframework.boot.context.properties.DeprecatedConfigurationProperty;
@@ -133,6 +135,8 @@ public List<String> getActiveDirectoryGroups() {
133135
*/
134136
public static class UserGroupProperties {
135137

138+
private final Log logger = LogFactory.getLog(UserGroupProperties.class);
139+
136140
/**
137141
* Expected UserGroups that an authority will be granted to if found in the response from the MemeberOf Graph
138142
* API Call.
@@ -175,7 +179,10 @@ public Boolean getEnableFullList() {
175179
return enableFullList;
176180
}
177181

182+
@Deprecated
178183
public void setEnableFullList(Boolean enableFullList) {
184+
logger.warn(" 'azure.activedirectory.user-group.enable-full-list' property detected! "
185+
+ "Use 'azure.activedirectory.user-group.allowed-group-ids: all' instead!");
179186
this.enableFullList = enableFullList;
180187
}
181188

@@ -190,6 +197,8 @@ public List<String> getAllowedGroups() {
190197

191198
@Deprecated
192199
public void setAllowedGroups(List<String> allowedGroups) {
200+
logger.warn(" 'azure.activedirectory.user-group.allowed-groups' property detected! " + " Use 'azure"
201+
+ ".activedirectory.user-group.allowed-group-names' instead!");
193202
this.allowedGroupNames = allowedGroups;
194203
}
195204

0 commit comments

Comments
 (0)