Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Using Azure AD Service Principals to Secure Applications

DZone's Guide to

Using Azure AD Service Principals to Secure Applications

With the new ARM model, you can use Azure AD service principals to secure applications. Read this article to find out how.

· Performance Zone
Free Resource

Evolve your approach to Application Performance Monitoring by adopting five best practices that are outlined and explored in this e-book, brought to you in partnership with BMC.

Custom applications typically need access to other resources in Azure, such as databases, REST APIs, and other PaaS services.  Azure AD allows you to create applications that function as service principals which enable your application to authenticate with Azure AD and can be granted roles within your subscription to provide access to resources in a secure way.

In the past, using the classic Azure Service Management API, Azure required you to create a self-signed management certificate and upload it to the portal to be used to authenticate an administrator.  This model has been replaced with the new ARM model.  Now you must authenticate as your service principal to Azure AD.  Your service principal must then be granted the necessary RBAC role in your subscription to gain access to resources.

Service principals can be authenticated by Azure AD either by:

1.  A Client ID and Secret.  The "Configure" tab in the Azure AD "Application" entry will display the applications Client ID as well as the option to create keys that function as the application secret.

AAD Config

2.  A certificate. Using PowerShell, you can upload and bind a certificate to an Azure AD principal that can be used for authentication. PowerShell ScriptOnce you have created your service principal, you can then use the ADAL library from just about any language or platform to authenticate using your credentials or your certificate to get back a JWT token which you can then use to authorize your application to just about any Azure resource

Evolve your approach to Application Performance Monitoring by adopting five best practices that are outlined and explored in this e-book, brought to you in partnership with BMC.

Topics:
azure ad ,oauth 2.0

Published at DZone with permission of Eric Grover. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}