• About

Information Dynamics

Information Dynamics

Monthly Archives: October 2019

Swagger UI in ASP.NET Core WebAPI

16 Wednesday Oct 2019

Posted by GIRISH SRINIVASA in ASP.NET Core, WebAPI

≈ Leave a comment

Tags

SwaggerUI

Webservices (ASMX and WCF) provided description of the services through WSDL. The WSDL file contains detailed information about the service in XML format including format of the messages, protocols used for the service etc. In ASP.NET Core WebApi project there is no user interface to obtained information about API and this context Swagger comes to the aid by providing a mechanism to visually present information about the WebApi.

The steps to include Swagger support in WebApi project include:

  • Create a ASP.NET Core WebAPI project
  • Add a reference to Nuget package Swashbuckle.AspNetCore
  • In the Startup.cs file make the following modifications to ConfigureServices and Configure method

swaggerui1

The IncludeXmlComments will show more descriptive information against each verb in WebApi and for this the comments should be generated out to an XML file and the build settings in the project will facilitate that as shown below:

swaggerui2

swaggerui3

  • In the Debug tab on project properties window under Launch browser enter “swagger”

swaggerui4

  • Now run the WebAPI project and the Swagger UI will look like the one below:

swaggerui5

How to view JSON data in IE instead of default download dialog

16 Wednesday Oct 2019

Posted by GIRISH SRINIVASA in ASP.NET Core, WebAPI

≈ Leave a comment

Tags

JSON data in IE

Save the following setting as <somename>.reg file and invoke

Windows Registry Editor Version 5.00
;
; Tell IE to open JSON documents in the browser.
; 25336920-03F9-11cf-8FD0-00AA00686F13 is the CLSID for the “Browse in place” .
;
[HKEY_CLASSES_ROOT\MIME\Database\Content Type\application/json]
“CLSID”=”{25336920-03F9-11cf-8FD0-00AA00686F13}”
“Encoding”=hex:08,00,00,00
[HKEY_CLASSES_ROOT\MIME\Database\Content Type\application/x-json]
“CLSID”=”{25336920-03F9-11cf-8FD0-00AA00686F13}”
“Encoding”=hex:08,00,00,00
[HKEY_CLASSES_ROOT\MIME\Database\Content Type\text/json]
“CLSID”=”{25336920-03F9-11cf-8FD0-00AA00686F13}”
“Encoding”=hex:08,00,00,00

 

Issues starting WebApi project in IIS Express

07 Monday Oct 2019

Posted by GIRISH SRINIVASA in ASP.NET Core

≈ Leave a comment

After creating a WebAPI/MVC project within VS2019 and trying to browse using IISExpress the following error message is received:

ASP.NETCore1

The launchSettings.json file will have a default setting of windowsAuthentication =false but this setting seems to not be enforced while the app is running.

ASP.NETCore2

In order to launch the WebAPI/MVC within IISExpress for debugging purposes add a Web.config file with the following highlighted setting:

ASP.NETCore3

Configuring Claims Based Authentication for Dynamics 9 on ADFS 4.0

04 Friday Oct 2019

Posted by GIRISH SRINIVASA in ADFS 4.0, Dynamics CE 9

≈ 1 Comment

Adding on-premise Dynamics 9 as a Relying-Party (RP) trust in ADFS 4.0 follows the same path as listed here but ADFS 4.0 has few changes to wizard options as detailed below:

CBA1

In the next step of the wizard make sure the metadata end point is accessible through IE, in the example below the URL is https://crm.idynamics.dev/FederationMetadata/2007-06/FederationMetadata.xml, give a display name and choose Next

CBA2

 

Access Control Policies defines the level of access that can be provided to RP

Untitled

Click Next after reviewing the following settings

Untitled1

The Relying Party (RP) will be added successfully the next step will the configuring Claims Issuance Policy (aka adding Claims Rules in ADFS 3.0 and below…)

Untitled2

Right click on RP and select Edit Claim Issuance Policy and add the claims rule set as indicated here

Untitled3

Once the RP has been successfully accessing the CRM organisation will display the following error because of certain defaults in ADFS 4.0

Untitled4

In the event viewer on ADFS server the above error will translate to a MSIS7102 error code of ADFS indicating an unsupported Authentication Method

Untitled5

In order to identify the Authentication Method  extract the redirection URL from CRM to ADFS and you will notice that Windows Integrated Authentication (WIA) is used as per wauth parameter, and this is not enabled in ADFS by default for Intranet scenarios

https://adfs.idynamics.dev/adfs/ls/?wa=wsignin1.0&wtrealm=https%3a%2f%2fcrm.idynamics.dev%2f&wctx=rm%3d1%26id%3df589b041-3924-4d87-a8f1-96057169b19f%26ru%3d%252fAPIS%252fdefault.aspx%26crmorgid%3df3f230c0-ddc6-e911-837e-0017fb000002&wct=2019-09-04T11%3a03%3a41Z&wauth=urn%3afederation%3aauthentication%3awindows

Bring up the ADFS management console and edit Primary Authentication Methods to include Windows Authentication and restart ADFS

Untitled6

Untitled7

Subscribe

  • Entries (RSS)
  • Comments (RSS)

Archives

  • November 2021
  • August 2021
  • July 2021
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • October 2019
  • September 2019
  • August 2019
  • July 2019
  • March 2019
  • September 2018
  • February 2018
  • January 2018
  • December 2017
  • January 2017
  • August 2016
  • January 2016
  • November 2015
  • October 2015
  • September 2015
  • November 2014
  • October 2014
  • September 2014
  • July 2014

Categories

  • ADCS
  • ADFS
  • ADFS 4.0
  • ASP.NET Core
  • Azure
  • Azure AD
  • Azure AD DS
  • Azure B2C
  • CRM 2011
  • CRM2013
  • CRM2015
  • CRM2016
  • Docker
  • Dynamics 365
  • Dynamics 365 CE Online
  • Dynamics 365 Portals
  • Dynamics CE 9
  • Knockout and TypeScript
  • OAuth2.0/OpenIDConnect
  • Power Platform
  • PowerApps
  • PowerShell
  • SharePoint 2019
  • Spkl
  • Uncategorized
  • WebAPI
  • Windows Server 2012
  • Windows Server 2016

Meta

  • Register
  • Log in

Blog at WordPress.com.

  • Follow Following
    • Information Dynamics
    • Already have a WordPress.com account? Log in now.
    • Information Dynamics
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar
 

Loading Comments...