("ServerSettings");
options.DefaultSystemScopes = udapServerOptions.DefaultSystemScopes;
options.DefaultUserScopes = udapServerOptions.DefaultUserScopes;
- options.ServerSupport = udapServerOptions.ServerSupport;
options.ForceStateParamOnAuthorizationCode = udapServerOptions.
ForceStateParamOnAuthorizationCode;
},
diff --git a/Udap.UI/Pages/UdapTieredLogin/Challenge.cshtml b/Udap.UI/Pages/UdapTieredLogin/Challenge.cshtml
index 885d4393..2e5efc7f 100644
--- a/Udap.UI/Pages/UdapTieredLogin/Challenge.cshtml
+++ b/Udap.UI/Pages/UdapTieredLogin/Challenge.cshtml
@@ -9,11 +9,12 @@
-
+ Challenge
-
+ Failed to process Tiered OAuth request.
+ Ensure the udap scope and idp parameter are included.
\ No newline at end of file
diff --git a/Udap.UI/Pages/UdapTieredLogin/Challenge.cshtml.cs b/Udap.UI/Pages/UdapTieredLogin/Challenge.cshtml.cs
index 6b23a2a6..cd26626c 100644
--- a/Udap.UI/Pages/UdapTieredLogin/Challenge.cshtml.cs
+++ b/Udap.UI/Pages/UdapTieredLogin/Challenge.cshtml.cs
@@ -11,6 +11,7 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
+using Microsoft.Extensions.Logging;
using Udap.Client.Client;
using Udap.Server.Security.Authentication.TieredOAuth;
@@ -22,25 +23,36 @@ public class Challenge : PageModel
{
private readonly IIdentityServerInteractionService _interactionService;
private readonly IUdapClient _udapClient;
+ private readonly ILogger _logger;
- public Challenge(IIdentityServerInteractionService interactionService, IUdapClient udapClient)
+ public Challenge(IIdentityServerInteractionService interactionService, IUdapClient udapClient, ILogger logger)
{
_interactionService = interactionService;
_udapClient = udapClient;
+ _logger = logger;
}
public async Task OnGetAsync(string scheme, string returnUrl)
{
if (string.IsNullOrEmpty(returnUrl)) returnUrl = "~/";
-
- var props = await TieredOAuthHelpers.BuildDynamicTieredOAuthOptions(
- _interactionService,
- _udapClient,
- scheme,
- "/udaptieredlogin/callback",
- returnUrl);
- // start challenge and roundtrip the return URL and scheme
- return Challenge(props, scheme);
+ try
+ {
+ var props = await TieredOAuthHelpers.BuildDynamicTieredOAuthOptions(
+ _interactionService,
+ _udapClient,
+ scheme,
+ "/udaptieredlogin/callback",
+ returnUrl);
+
+ // start challenge and roundtrip the return URL and scheme
+ return Challenge(props, scheme);
+ }
+ catch (Exception ex)
+ {
+ _logger.LogWarning($"Failed Tiered Oauth for returnUrl: {returnUrl}");
+ }
+
+ return Page();
}
}
\ No newline at end of file
diff --git a/Udap.sln b/Udap.sln
index ce24285b..8d955d04 100644
--- a/Udap.sln
+++ b/Udap.sln
@@ -21,6 +21,7 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{522A1681-215E-4C39-B1AC-1324F7CE516E}"
ProjectSection(SolutionItems) = preProject
.dockerignore = .dockerignore
+ .gitignore = .gitignore
Common.props = Common.props
Directory.Build.props = Directory.Build.props
Directory.Packages.props = Directory.Packages.props
@@ -82,9 +83,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Udap.UI", "Udap.UI\Udap.UI.
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Udap.Proxy.Server", "examples\Udap.Proxy.Server\Udap.Proxy.Server.csproj", "{BC032973-A216-483C-8C5B-C7B5D9EB0D19}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Udap.Smart.Metadata", "Udap.Smart.Metadata\Udap.Smart.Metadata.csproj", "{6E2FC3C1-53B0-46F6-981F-58AC96462F2F}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Udap.Smart.Metadata", "Udap.Smart.Metadata\Udap.Smart.Metadata.csproj", "{6E2FC3C1-53B0-46F6-981F-58AC96462F2F}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Udap.Smart.Model", "Udap.Smart.Model\Udap.Smart.Model.csproj", "{DD9B2367-11A6-448C-B733-F5F436A0AA87}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Udap.Smart.Model", "Udap.Smart.Model\Udap.Smart.Model.csproj", "{DD9B2367-11A6-448C-B733-F5F436A0AA87}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
diff --git a/_tests/Directory.Packages.props b/_tests/Directory.Packages.props
index abdbeecf..a39619ab 100644
--- a/_tests/Directory.Packages.props
+++ b/_tests/Directory.Packages.props
@@ -6,31 +6,31 @@
-
-
+
+
-
+
-
-
-
-
+
+
+
+
-
+
-
-
+
+
-
+
\ No newline at end of file
diff --git a/_tests/Udap.Client.System.Tests/IdServerRegistrationTests.cs b/_tests/Udap.Client.System.Tests/IdServerRegistrationTests.cs
index f4652467..21e12f25 100644
--- a/_tests/Udap.Client.System.Tests/IdServerRegistrationTests.cs
+++ b/_tests/Udap.Client.System.Tests/IdServerRegistrationTests.cs
@@ -1187,9 +1187,10 @@ public async Task RegistrationSuccess_authorization_code_FhirLabs_desktop_Test()
"mailto:Joseph.Shook@Surescripts.com", "mailto:JoeShook@gmail.com"
})
.WithTokenEndpointAuthMethod(UdapConstants.RegistrationDocumentValues.TokenEndpointAuthMethodValue)
- // .WithScope("user/Patient.* user/Practitioner.read") //Comment out for UDAP Server mode.
+ .WithScope("user/Patient.read") //Comment out for UDAP Server mode.
.WithResponseTypes(new HashSet { "code" })
.WithRedirectUrls(new List { new Uri($"https://client.fhirlabs.net/redirect/{Guid.NewGuid()}").AbsoluteUri }!)
+ .WithLogoUri("https://avatars.githubusercontent.com/u/77421324?s=48&v=4")
.Build();
@@ -1215,7 +1216,7 @@ public async Task RegistrationSuccess_authorization_code_FhirLabs_desktop_Test()
using var idpClient = new HttpClient(); // New client. The existing HttpClient chains up to a CustomTrustStore
var response = await idpClient.PostAsJsonAsync(reg, requestBody);
- response.StatusCode.Should().Be(HttpStatusCode.Created);
+ response.StatusCode.Should().BeOneOf(HttpStatusCode.Created, HttpStatusCode.OK);
response.Content.Headers.ContentType!.ToString().Should().Be("application/json");
// var documentAsJson = JsonSerializer.Serialize(document);
@@ -1295,7 +1296,7 @@ public async Task RegistrationSuccess_authorization_code_FhirLabs_desktop_Test()
clientId: result.ClientId!,
responseType: "code",
state: CryptoRandom.CreateUniqueId(),
- scope: "udap user.cruds",
+ scope: "user/Patient.read",
redirectUri: document.RedirectUris!.First());
_testOutputHelper.WriteLine(url);
@@ -1308,7 +1309,7 @@ public async Task RegistrationSuccess_authorization_code_FhirLabs_desktop_Test()
response.StatusCode.Should().Be(HttpStatusCode.Redirect);
var authUri = new Uri(disco.AuthorizeEndpoint!);
- var loginUrl = $"{authUri.Scheme}://{authUri.Authority}/Account/Login";
+ var loginUrl = $"{authUri.Scheme}://{authUri.Authority}/udapaccount/login";
response.Headers.Location?.ToString().Should()
.StartWith(loginUrl);
@@ -1335,17 +1336,6 @@ public async Task RegistrationSuccess_authorization_code_FhirLabs_desktop_Test()
}
-
- //
- // IDP Server must be running in ServerSupport mode of ServerSupport.UDAP for this to fail and pass the test.
- // See part of test where getting Access Token
- // var jwtPayload = new JwtPayload(
- // result.Issuer,
- //
- // vs normal
- //
- // var jwtPayload = new JwtPayload(
- // result.ClientId,
//
// If you want Udap.Idp to run in UDAP mode the use "ASPNETCORE_ENVIRONMENT": "Production" to launch. Or
// however you get the serer to pickup appsettings.Production.json
diff --git a/_tests/Udap.PKI.Generator/BuildNginxProxySSLCerts.cs b/_tests/Udap.PKI.Generator/BuildNginxProxySSLCerts.cs
index 9f9bc2a6..b526f834 100644
--- a/_tests/Udap.PKI.Generator/BuildNginxProxySSLCerts.cs
+++ b/_tests/Udap.PKI.Generator/BuildNginxProxySSLCerts.cs
@@ -176,8 +176,31 @@ public static IEnumerable