Skip to content

Commit b31857e

Browse files
committed
Merge remote-tracking branch 'remotes/origin/main' into bugfix-pcf2-design
2 parents 4dce1a3 + 8518e82 commit b31857e

File tree

2 files changed

+33
-27
lines changed

2 files changed

+33
-27
lines changed

examples/MiniClientCredential/MiniClientCredential/Program.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,10 @@
7171
new Claim(JwtRegisteredClaimNames.Iat,
7272
new DateTimeOffset(now).ToUnixTimeSeconds().ToString(),
7373
ClaimValueTypes.Integer64),
74+
new Claim("client_id", clientId),
7475
new Claim("serverName", serverName),
75-
new Claim("userName", userName)
76+
new Claim("userName", userName),
77+
new Claim("email", userName)
7678
};
7779

7880
var jwt = new JwtSecurityToken(

src/AasxServerBlazor/Shared/MainLayout.razor

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
@{
133133
if (_edit)
134134
{
135-
<span style="color:red;">edit</span>
135+
<span style="color:red;">edit</span>
136136
}
137137

138138
async Task update()
@@ -154,39 +154,43 @@
154154
Program.submodelAPIcount = 0;
155155
break;
156156
default:
157-
{
158-
if (CurrentValue.Contains("FORCE-POLICY"))
159157
{
160-
Program.withPolicy = CurrentValue.Contains("ON");
161-
}
162-
else
163-
{
164-
if (CurrentValue.Contains("get="))
158+
if (CurrentValue.Contains("FORCE-POLICY"))
165159
{
166-
CurrentValue = CurrentValue.Replace("get=", "");
167-
Program.getUrl = CurrentValue;
168-
Program.signalNewData(2);
169-
}
170-
else if (CurrentValue.Contains("secret="))
171-
{
172-
CurrentValue = CurrentValue.Replace("secret=", "");
173-
Program.getUrl = CurrentValue;
174-
Program.signalNewData(2);
160+
Program.withPolicy = CurrentValue.Contains("ON");
175161
}
176162
else
177163
{
178-
if (string.IsNullOrEmpty(_role))
179-
_role = roleList[ 0 ];
180-
if (CurrentValue.Contains("Email=") || CurrentValue.Contains("@"))
164+
if (CurrentValue.Contains("get="))
181165
{
182-
CurrentValue = CurrentValue.Replace("Email=", "");
183-
AasxCredentials.initByEmail(cs.credentials, CurrentValue);
184-
_input = CurrentValue;
185-
_role = string.Empty;
166+
CurrentValue = CurrentValue.Replace("get=", "");
167+
Program.getUrl = CurrentValue;
168+
Program.signalNewData(2);
169+
}
170+
else if (CurrentValue.Contains("secret="))
171+
{
172+
CurrentValue = CurrentValue.Replace("secret=", "");
173+
Program.getUrl = CurrentValue;
174+
Program.signalNewData(2);
186175
}
187-
else if (CurrentValue.Contains("CREDENTIALS-") && CurrentValue.Contains(".DAT"))
176+
else
188177
{
189-
AasxCredentials.initByFile(cs.credentials, CurrentValue);
178+
if (string.IsNullOrEmpty(_role))
179+
_role = roleList[ 0 ];
180+
if (CurrentValue.Contains("Email=") || CurrentValue.Contains("@"))
181+
{
182+
CurrentValue = CurrentValue.Replace("Email=", "");
183+
AasxCredentials.initByEmail(cs.credentials, CurrentValue);
184+
_input = CurrentValue;
185+
_role = string.Empty;
186+
}
187+
else if (CurrentValue == "cb" || (CurrentValue.Contains("CREDENTIALS-") && CurrentValue.Contains(".DAT")))
188+
{
189+
if (CurrentValue == "cb")
190+
{
191+
CurrentValue = "CREDENTIALS-BEARER.DAT";
192+
}
193+
AasxCredentials.initByFile(cs.credentials, CurrentValue);
190194
_input = CurrentValue;
191195
_role = string.Empty;
192196
}

0 commit comments

Comments
 (0)