Overview
Atlassian Sourcetree is a free Git and Mercurial client for Windows.
Atlassian Sourcetree is a free Git and Mercurial client for Mac.
Server-side CRM authentication using Azure Active Directory
-
Load the project and make sure it compiles. VS2013 is recommended but it seems to work in VS2012 as well.
-
Register your application in Azure Active Directory
- In Azure go to Active Directory -> Applications -> Add.
- When prompted choose “Add an application my organization is developing”
- Next: enter name of your choice, select “Web application and/or web API” as type
- Next: APP URL is https://localhost:44300, APP ID URI is https://caseowary (latter must be unique within your org directory, use whatever you want and, as you can see, it’s URI not URL)
- Next: SINGLE SIGN-ON
-
Now you should see
- APP ID URI: https://caseowary. IMPORTANT! This is URI not URL so things like trailing slash matter. Don’t waste 2 extra hours as I did.
- FEDERATION METADATA URL: https://login.windows.net/<your_tenant_guid>/FederationMetadata/2007-06/FederationMetadata.xml.
-
Click CONFIGURE
- Scroll to CLIENT ID (1) and copy it to web.config
- Select duration under KEYS (2)
- Change REPLY URL (3) to https://localhost:44300/reply. That goes into web.config
- Hit Save. Copy key value from KEYS section into web.config. IMPORTANT! Message does not lie about this is the last time you see this key so copy it now.

web.config entries
<appSettings>
<add key="ida:Realm" value="3.1_app_id_uri" />
<add key="ida:AudienceUri" value="3.1_app_id_uri" />
<add key="TenantId" value="3.2_your_tenant_guid" />
<add key="ClientId" value="4.1_client_id" />
<add key="RedirectUrl" value="4.3_reply_url" />
<add key="AuthorizationKey" value="4.4_authorization_key" />
<!-- Self-explanatory entries -->
<add key="OrgUrl" value="https://yourorg.crm.dynamics.com/" />
<add key="ODataUrl" value="https://yourorg.crm.dynamics.com/XRMServices/2011/OrganizationData.svc/" />
<add key="OrgSvcUrl" value="https://yourorg.api.crm.dynamics.com/XRMServices/2011/Organization.svc/web" />