Skip to content

Commit

Permalink
BCeID implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
ychung-mot committed Dec 17, 2019
1 parent d2716ef commit fdb6b93
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 9 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/.vscode
.vs
node_modules/
node_modules/
bceid.json
chris.json
3 changes: 2 additions & 1 deletion api/Hmcr.Api/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,6 @@
"BCEID_USER": "<bceiduser>",
"BCEID_PASSWORD": "<bceidpassword>",
"BCEID_URL": "https://gws1.test.bceid.ca/webservices/client/v10/bceidservice.asmx",
"BCEID_OSID": ""
"BCEID_OSID": "",
"BCEID_GUID": ""
}
1 change: 1 addition & 0 deletions api/Hmcr.Bceid/BCeIDServiceSoapClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ namespace BceidService
public partial class BCeIDServiceSoapClient
{
public string Osid { get; set; }
public string Guid { get; set; }
}
}
6 changes: 3 additions & 3 deletions api/Hmcr.Bceid/BceidApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Hmcr.Bceid
{
public interface IBceidApi
{
Task<(string Error, BceidAccount account)> GetBceidAccountAsync(string requestUserGuid, string username, string userType);
Task<(string Error, BceidAccount account)> GetBceidAccountAsync(string username, string userType);
}

public class BceidApi : IBceidApi
Expand All @@ -23,13 +23,13 @@ public BceidApi(BCeIDServiceSoapClient client)
_client = client;
}

public async Task<(string Error, BceidAccount account)> GetBceidAccountAsync(string requestUserGuid, string username, string userType)
public async Task<(string Error, BceidAccount account)> GetBceidAccountAsync(string username, string userType)
{
var typeCode = userType.IsIdirUser() ? BCeIDAccountTypeCode.Internal : BCeIDAccountTypeCode.Business;

var request = new AccountDetailRequest();
request.requesterAccountTypeCode = BCeIDAccountTypeCode.Internal;
request.requesterUserGuid = requestUserGuid;
request.requesterUserGuid = _client.Guid;
request.accountTypeCode = typeCode;
request.userId = username;
request.onlineServiceId = _client.Osid;
Expand Down
2 changes: 2 additions & 0 deletions api/Hmcr.Bceid/BceidServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public static void AddBceidSoapClient(this IServiceCollection services, IConfigu
var password = config.GetValue<string>("BCEID_PASSWORD");
var url = config.GetValue<string>("BCEID_URL");
var osid = config.GetValue<string>("BCEID_OSID");
var guid = config.GetValue<string>("BCEID_GUID");

var binding = new BasicHttpsBinding(BasicHttpsSecurityMode.Transport);
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic;
Expand All @@ -27,6 +28,7 @@ public static void AddBceidSoapClient(this IServiceCollection services, IConfigu
client.Endpoint.Binding = binding;
client.Endpoint.Address = new EndpointAddress(url);
client.Osid = osid;
client.Guid = guid;

return client;
});
Expand Down
3 changes: 2 additions & 1 deletion api/Hmcr.Bceid/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"BCEID_USER": "<bceiduser>",
"BCEID_PASSWORD": "<bceidpassword>",
"BCEID_URL": "https://gws1.test.bceid.ca/webservices/client/v10/bceidservice.asmx",
"BCEID_OSID": ""
"BCEID_OSID": "",
"BCEID_GUID": ""
}

6 changes: 3 additions & 3 deletions client/.env.development
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BROWSER=none
REACT_APP_API_HOST=http://localhost:27238/api
REACT_APP_SSO_CLIENT=
REACT_APP_SSO_REALM=
REACT_APP_SSO_HOST=
REACT_APP_SSO_CLIENT=hmcr-public
REACT_APP_SSO_REALM=fygf50pt
REACT_APP_SSO_HOST=https://sso-dev.pathfinder.gov.bc.ca/auth
REACT_APP_DEFAULT_PAGE_SIZE_OPTIONS=25,50,100,200
REACT_APP_DEFAULT_PAGE_SIZE=25
Binary file modified openshift/secrets/bceid-secrets.yaml
Binary file not shown.

0 comments on commit fdb6b93

Please sign in to comment.