-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from hmcts/EM-1875-openId-connect-updates
Em 1875 open id connect updates
- Loading branch information
Showing
15 changed files
with
303 additions
and
94 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
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
22 changes: 4 additions & 18 deletions
22
src/main/java/uk/gov/hmcts/reform/em/test/idam/IdamConfiguration.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,37 +1,23 @@ | ||
package uk.gov.hmcts.reform.em.test.idam; | ||
|
||
import okhttp3.OkHttpClient; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | ||
import org.springframework.cloud.openfeign.EnableFeignClients; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.ComponentScan; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.Scope; | ||
import uk.gov.hmcts.reform.idam.client.IdamClient; | ||
import uk.gov.hmcts.reform.idam.client.IdamTestApi; | ||
|
||
import java.net.InetSocketAddress; | ||
import java.net.Proxy; | ||
|
||
@Configuration | ||
@ConditionalOnProperty("idam.api.url") | ||
@ComponentScan(basePackages = "uk.gov.hmcts.reform.idam.client") | ||
@EnableFeignClients(basePackages = {"uk.gov.hmcts.reform.em.test.idam", "uk.gov.hmcts.reform.idam.client"}) | ||
public class IdamConfiguration { | ||
|
||
@Bean | ||
IdamHelper idamHelper(IdamClient idamClient, IdamTestApi idamTestApi, DeleteUserApi deleteUserApi) { | ||
return new IdamHelper(idamClient, idamTestApi, deleteUserApi); | ||
} | ||
|
||
@Bean | ||
@Scope("prototype") | ||
public OkHttpClient client() { | ||
|
||
OkHttpClient okHttpClient = new OkHttpClient.Builder() | ||
.proxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("proxyout.reform.hmcts.net", 8080))) | ||
.build(); | ||
|
||
return okHttpClient; | ||
IdamHelper idamHelper(IdamClient idamClient, IdamTestApi idamTestApi, DeleteUserApi deleteUserApi, | ||
OpenIdUserApi openIdUserApi, OpenIdConfiguration openIdConfiguration) { | ||
return new IdamHelper(idamClient, idamTestApi, deleteUserApi, openIdUserApi, | ||
openIdConfiguration); | ||
} | ||
} |
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
39 changes: 39 additions & 0 deletions
39
src/main/java/uk/gov/hmcts/reform/em/test/idam/OpenIdConfiguration.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,39 @@ | ||
package uk.gov.hmcts.reform.em.test.idam; | ||
|
||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
public class OpenIdConfiguration { | ||
|
||
private String clientId; | ||
private String redirectUri; | ||
private String grant_type; | ||
private String scope; | ||
|
||
public OpenIdConfiguration(@Value("${idam.client.id:}") String clientId, | ||
@Value("${idam.client.redirect_uri:}") String redirectUri, | ||
@Value("${idam.client.scope:}") String scope, | ||
@Value("${idam.client.grant_type:}") String grant_type) { | ||
this.clientId = clientId; | ||
this.redirectUri = redirectUri; | ||
this.grant_type = grant_type; | ||
this.scope = scope; | ||
} | ||
|
||
public String getClientId() { | ||
return clientId; | ||
} | ||
|
||
public String getRedirectUri() { | ||
return redirectUri; | ||
} | ||
|
||
public String getGrantType() { | ||
return grant_type; | ||
} | ||
|
||
public String getScope() { | ||
return scope; | ||
} | ||
} |
Oops, something went wrong.