Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Endret oppslag av client ID/secret til å hente verdi fra NAIS-variabler hvis satt. #3687

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,20 @@
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

/**
* Get configuration from, in prioritized order:
* <ol>
* <li>{@code AZURE_APP_CLIENT_[ID|SECRET]} (provided by NAIS when running in pod)</li>
* <li>{@code spring.security.oauth2.client.registration.aad.client-[id|secret]} (configured when running locally)</li>
* <li>{@code null} (for test purposes)</li>
* </ol>
*/
@Configuration
public class AzureNavClientCredential extends ClientCredential {

public AzureNavClientCredential(
@Value("${spring.security.oauth2.client.registration.aad.client-id:#{null}}") String clientId,
@Value("${spring.security.oauth2.client.registration.aad.client-secret:#{null}}") String clientSecret
@Value("#{systemProperties['AZURE_APP_CLIENT_ID'] ?: '${spring.security.oauth2.client.registration.aad.client-id:#{null}}'}") String clientId,
@Value("#{systemProperties['AZURE_APP_CLIENT_SECRET'] ?: '${spring.security.oauth2.client.registration.aad.client-secret:#{null}}'}") String clientSecret
) {
super(clientId, clientSecret);
}
Expand Down
Loading