Skip to content

Commit 1f934a9

Browse files
committed
fixes
1 parent 054d9f7 commit 1f934a9

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

Samples/GDS/Client/MainForm.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public MainForm(ApplicationInstance application)
6464

6565
m_filters = new QueryServersFilter();
6666
m_identity = new UserIdentity();
67-
m_gds = new GlobalDiscoveryServerClient(m_application.ApplicationConfiguration, m_configuration.GlobalDiscoveryServerUrl);
67+
m_gds = new GlobalDiscoveryServerClient(m_application.ApplicationConfiguration);
6868
m_gds.KeepAlive += GdsServer_KeepAlive;
6969
m_gds.ServerStatusChanged += GdsServer_StatusNotification;
7070
m_lds = new LocalDiscoveryServerClient(m_application.ApplicationConfiguration);

Samples/GDS/Server/Program.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
using System;
3737
using System.Collections.Generic;
3838
using System.Data.Entity;
39+
using System.Text;
3940

4041
namespace Opc.Ua.Gds.Server
4142
{
@@ -86,8 +87,7 @@ static void Main()
8687
database,
8788
new CertificateGroup(),
8889
userDatabase,
89-
true,
90-
createStandardUsers);
90+
true);
9191
application.StartAsync(server).Wait();
9292

9393
// run the application interactively.
@@ -122,10 +122,10 @@ private static bool ConfigureUsers(SqlUsersDatabase userDatabase)
122122
_ = password ?? throw new ArgumentNullException("Password is not allowed to be empty");
123123

124124
//create User, if User exists delete & recreate
125-
if (!userDatabase.CreateUser(username, password, new List<Role>() { Role.AuthenticatedUser, GdsRole.CertificateAuthorityAdmin, GdsRole.DiscoveryAdmin }))
125+
if (!userDatabase.CreateUser(username, Encoding.UTF8.GetBytes(password), new List<Role>() { Role.AuthenticatedUser, GdsRole.CertificateAuthorityAdmin, GdsRole.DiscoveryAdmin }))
126126
{
127127
userDatabase.DeleteUser(username);
128-
userDatabase.CreateUser(username, password, new List<Role>() { Role.AuthenticatedUser, GdsRole.CertificateAuthorityAdmin, GdsRole.DiscoveryAdmin });
128+
userDatabase.CreateUser(username, Encoding.UTF8.GetBytes(password), new List<Role>() { Role.AuthenticatedUser, GdsRole.CertificateAuthorityAdmin, GdsRole.DiscoveryAdmin });
129129
}
130130
}
131131
return createStandardUsers;

Workshop/UserAuthentication/Client/MainForm.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,8 +474,8 @@ private void CertificateImpersonateBTN_Click(object sender, EventArgs e)
474474
// want to get error text for this call.
475475
m_session.ReturnDiagnostics = DiagnosticsMasks.All;
476476

477-
UserIdentity identity = new UserIdentity(certificate, null);
478-
string[] preferredLocales = PreferredLocalesTB.Text.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
477+
UserIdentity identity = new UserIdentity(certificate);
478+
string[] preferredLocales = PreferredLocalesTB.Text.Split([','], StringSplitOptions.RemoveEmptyEntries);
479479
m_session.UpdateSession(identity, preferredLocales);
480480

481481
MessageBox.Show("User identity changed.", "Impersonate User", MessageBoxButtons.OK, MessageBoxIcon.Information);

0 commit comments

Comments
 (0)