%3CLINGO-SUB%20id%3D%22lingo-sub-1574028%22%20slang%3D%22en-US%22%3ERe%3A%20Let's%20Talk%20About%20Azure%20Active%20Directory%20and%20the%20Microsoft%20Identity%20Platform%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1574028%22%20slang%3D%22en-US%22%3E%3CP%3Esuper%20useful%2C%20thank%20you%20for%20sharing!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1575707%22%20slang%3D%22en-US%22%3ERe%3A%20Let's%20Talk%20About%20Azure%20Active%20Directory%20and%20the%20Microsoft%20Identity%20Platform%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1575707%22%20slang%3D%22en-US%22%3E%3CP%3EGreat%20article.%20I%20was%20following%20up%20until%20the%20part%20about%20front%20end%20and%20back%20end%20scope.%20I%20understand%20consent%20but%20not%20sure%20I%20understand%20the%20reason%20for%20the%202%20AAD%20%22apps%22%20and%20the%20relationship%20between%20them.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20gather%20this%20article%20is%20mostly%20for%20people%20developing%20apps%2C%20and%20not%20people%20like%20me%20who%20provide%20the%20IdP%20for%20those%20apps%2C%20either%20through%20gallery%20apps%20or%20custom%20apps.%20I%20leave%20the%20endpoints%20to%20the%20developers%20and%20they%20must%20tell%20me%20what%20to%20configure%20on%20the%20AAD%20side.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EA%20lot%20of%20what%20I'm%20doing%20is%20transitioning%20SAML2%20apps%20from%20ADFS%20to%20AAD%20or%20adding%20new%20OAuth%20apps%20to%20AAD.%20Also%20implementing%20admin%20consent%20workflows.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1571939%22%20slang%3D%22en-US%22%3ELet's%20Talk%20About%20Azure%20Active%20Directory%20and%20the%20Microsoft%20Identity%20Platform%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1571939%22%20slang%3D%22en-US%22%3E%3CP%3EHave%20you%20been%20following%20along%20with%20all%20the%20changes%20in%20Azure%20Active%20Directory%20(AD)-land%20and%20the%20various%20Microsoft%20Identity%20branded%20things%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E(Especially%20since%20my%20%3CA%20href%3D%22https%3A%2F%2Fcodemilltech.com%2Ftag%2Fazure-ad-b2c%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Eepic%20series%3C%2FA%3E%26nbsp%3Bon%20all%20things%20Azure%20AD%20B2C%3F)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20changes%20and%20new%20features%20are%20amazing%20but%20change%20can%20be%20confusing.%20So%20let's%20have%20a%20little%20chat%20about%20Azure%20AD%20and%20Microsoft%20Identity.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1295446564%22%20id%3D%22toc-hId--1295446564%22%20id%3D%22toc-hId--1295446564%22%3EThe%20Quick%20Tour%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOK%20-%20so%20I'm%20going%20to%20level%20with%20you...%20the%20way%20things%20are%20named%20in%20Microsoft's%20Identity%20Platform%20is%20a%20little%20bit...%20well%2C%20confusing.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20just%20illustrated%20my%20own%20point%20-%20I%20said%20Microsoft%20Identity%20Platform%20without%20introducing%20it%20first.%20What%20in%20the%20world%20does%20that%20even%20mean%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CFONT%20color%3D%22%23808080%22%3EMicrosoft%20uses%20the%20term%20Microsoft%20Identity%20Platform%20as%20the%20next%20evolution%20to%20the%20Azure%20Active%20Directory%20Developer%20Platform.%20It's%20the%20all%20encompassing%20term%20for%20building%20apps%20with%20Azure%20AD.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20official%20-ERR%3AREF-NOT-FOUND-Microsoft%20Identity%20Platform%20docs%20are%20%3CEM%3Egood%3C%2FEM%3E.%20Surprisingly%20good.%20But%2C%20you%20still%20need%20to%20know%20what%20you're%20talking%20about%20before%20really%20grabbing%20and%20retaining%20info%20from%20the%20docs.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESo%20let's%20take%20the%20quick%20tour%20around%20Azure%20AD%20and%20Microsoft%20Identity%20XXX%20and%20try%20to%20remove%20any%20confusion%20around%20process%20and%20terms.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--604885090%22%20id%3D%22toc-hId--604885090%22%20id%3D%22toc-hId--604885090%22%3EAzure%20AD%20Sign-In%20Overview%3C%2FH3%3E%0A%3CP%3EThe%20super%20high%20level%20overview%20of%20Azure%20AD%20is%20that%20it%20is%20an%20%3CSTRONG%3EIdentity%20Provider%3C%2FSTRONG%3E%26nbsp%3B(or%20IdP).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIt%20verifies%20your%20users%20are%20who%20they%20say%20they%20are%20-%20and%20one%20way%20can%20be%20by%20username%20and%20password.%3C%2FP%3E%0A%3CP%3EAfter%20it%20successfully%20verifies%20the%20user%2C%20it%20returns%20two%20tokens.%20A%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Factive-directory%2Fdevelop%2Fsecurity-tokens%3FWT.mc_id%3Daddemystify-techcommunity-masoucou%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSTRONG%3EToken%3C%2FSTRONG%3E%3C%2FA%3E%20is%20a%20Base64%20encoded%20string%20(also%20known%20as%20a%20%3CA%20href%3D%22https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FJSON_Web_Token%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EJSON%20Web%20Token%20(JWT)%3C%2FA%3E%2C%20which%20is%20just%20a%20standard)%20that%20has%20information%20in%20it%20about%20the%20user.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThat%20info%20is%20known%20as%20%3CSTRONG%3EClaims%3C%2FSTRONG%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThink%20of%20it%20as...%20a%20user%20signs%20in%2C%20Azure%20AD%20verifies%20they%20are%20who%20they%20say%20they%20are%2C%20and%20returns%202%20tokens%20full%20of%20information%20that%20Azure%20AD%20claims%20is%20true%20about%20that%20user.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOh%20-%20and%20those%202%20token%20flavors%3F%20One%20is%20known%20as%20an%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Factive-directory%2Fdevelop%2Fid-tokens%3FWT.mc_id%3Daddemystify-techcommunity-masoucou%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSTRONG%3EIdentity%20token%3C%2FSTRONG%3E%3C%2FA%3E.%20And%20the%20other%20is%20an%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Factive-directory%2Fdevelop%2Faccess-tokens%3FWT.mc_id%3Daddemystify-techcommunity-masoucou%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSTRONG%3EAccess%20token%3C%2FSTRONG%3E%3C%2FA%3E.%20An%20Identity%20token%20has%20information%20about%20the%20user.%20And%20an%20Access%20token%20is%20used%20to%20gain%20access%20to%20other%20resources%20-%20like%20a%20Web%20API.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22tokens_nufhfw%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F210866i3DC96B248D640289%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22tokens_nufhfw%22%20alt%3D%22tokens_nufhfw%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThere's%20more%20to%20it%20than%20that%20-%20but%20that's%20the%20gist.%20And%20those%20are%20also%20the%20standard%20terms%20you'll%20see%20docs%20and%20blogs%20throw%20around%20when%20talking%20about%20signing%20in%20users.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-1882627743%22%20id%3D%22toc-hId-1882627743%22%20id%3D%22toc-hId-1882627743%22%3ECommunicating%20with%20Azure%20AD%3C%2FH3%3E%0A%3CP%3EThis%20is%20where%20we%20could%20get%20deep%2C%20deep%20into%20the%20details%20-%20so%20I'll%20do%20my%20best%20not%20to.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThere%20are%20industry%20standards%20that%20Azure%20AD%20implements%20that%20allow%20your%20app%20to%20talk%20to%20it.%3C%2FP%3E%0A%3CP%3EYou've%20probably%20heard%20of%20some%20of%20them%20before%20-%20like%20OpenID%20Connect%20or%20OAuth.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20our%20discussion%2C%20these%20aren't%20important%20other%20than%20to%20know%20Azure%20AD%20supports%20them.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESupporting%20them%20means%20somebody%20else%20can%20write%20an%20SDK%20to%20abstract%20away%20all%20the%20intricacies%20of%20implementing%20the%20standard%20yourself%20to%20do%20the%20communication.%20That's%20a%20big%20deal%2C%20you%20don't%20want%20to%20mess%20up%20people%20signing%20in%20to%20your%20app.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESpecifically%2C%20the%20sign-in%20request%20to%20Azure%20AD%20will%20be%20directed%20at%20an%20%3CSTRONG%3Eendpoint%3C%2FSTRONG%3E.%20And%20this%20is%20where%20things%20get%20confusing.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThere%20used%20to%20be%20v1%20endpoints.%20Now%20there%20are%20v2%20endpoints.%20And%20you%20may%20even%20hear%20folks%20talk%20about%20Microsoft%20Identity%20Platform%20endpoints.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBut%20endpoints%20are%20really%20a%20part%20of%20Azure%20AD%20Applications...%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId--1721778079%22%20id%3D%22toc-hId--1721778079%22%20id%3D%22toc-hId--1721778079%22%3EAzure%20AD%20Applications%3C%2FH4%3E%0A%3CP%3EYou%20can%20think%20of%20an%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Factive-directory%2Fdevelop%2Factive-directory-how-applications-are-added%3FWT.mc_id%3Daddemystify-techcommunity-masoucou)%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSTRONG%3EAzure%20AD%20Application%3C%2FSTRONG%3E%3C%2FA%3E%26nbsp%3Bas%20a%20representation%20of%20your%20%22real%22%20app%20in%20Azure%20AD.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESo%20let's%20say%20you%20had%20a%20todo%20list%20application.%20That%20application%20has%20a%20web%20app%2C%20mobile%20app%2C%20and%20a%20web%20API.%3C%2FP%3E%0A%3CP%3EWithin%20Azure%20AD%2C%20you%20would%20have%202%20applications.%20One%20to%20model%20the%20frontend%20apps.%20The%20other%20to%20model%20the%20web%20API.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhy%20a%20separate%20one%20to%20model%20the%20web%20API%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20goes%20back%20to%20those%20access%20tokens%20from%20before.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20user%20of%20the%20frontend%20app%20will%20authenticate%20with%20Azure%20AD%20and%20get%20an%20access%20token%20that%20will%20be%20passed%20to%20the%20web%20API%20to%20get%20access%20to%20it.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThat%20access%20is%20granted%20by%20a%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Factive-directory%2Fdevelop%2Fv2-permissions-and-consent%3FWT.mc_id%3Daddemystify-techcommunity-masoucou%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSTRONG%3EScope%3C%2FSTRONG%3E%3C%2FA%3E.%20It's%20a%20portion%20of%20the%20backend's%20functionality%20that%20is%20scoped%20out%20for%20other%20application's%20to%20use.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESo%20-ERR%3AREF-NOT-FOUND-through%20the%20Azure%20AD%20portal%2C%20you%20create%20(or%20expose)%20a%20scope%20(or%20API%20permission%20as%20it%20will%20sometimes%20be%20called)%20for%20the%20backend's%20Azure%20AD%20Application.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThen%20the%20frontend%20application%20is%20granted%20permission%20to%20that%20scope%20(again%20through%20the%20portal).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhen%20the%20user%20signs%20in%20-%20they%20will%20be%20asked%20to%20%3CSTRONG%3EConsent%3C%2FSTRONG%3E%20to%20the%20backend%20scope%20being%20used.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you've%20ever%20used%20your%20Twitter%20credentials%20to%20signup%20for%20an%20account%20on%20another%20service%2C%20you're%20already%20familiar%20with%20the%20consent%20screen.%20It's%20the%20%3CEM%3E%22Application%20ABCD%20wants%20to%20read%20your%20timeline%22.%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYour%20code%20is%20responsible%20for%20asking%20for%20the%20particular%20scope%20needed%20when%20signing-in%20to%20the%20frontend.%20And%20on%20the%20backend%2C%20your%20code%20is%20responsible%20for%20checking%20any%20authorization.%20Scopes%20tell%20you%20what's%20going%20to%20happen%2C%20but%20leave%20the%20implementation%20details%20up%20to%20you.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId-765734754%22%20id%3D%22toc-hId-765734754%22%20id%3D%22toc-hId-765734754%22%3EAzure%20AD%20Application%20Types%20and%20Endpoints%3C%2FH4%3E%0A%3CP%3EOk%2C%20to%20make%20Azure%20AD%20Applications%20a%20bit%20more%20confusing%2C%20there%20are%20a%20bunch%20of%20different%20types%20of%20them.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EV1%2C%20V2%2C%20and%20Microsoft%20Identity%20Platform%20applications.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETo%20get%20this%20out%20of%20the%20way%20-%20V2%20and%20Microsoft%20Identity%20Platform%20applications%20are%20exactly%20the%20same%20thing.%20Just%20a%20rebranding%2C%20if%20you%20will.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EV2%20applications%20are%20a%20newer%20version%20of%20Azure%20AD%20Applications%20than%20V1.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThey%20-ERR%3AREF-NOT-FOUND-support%20more%20functionality%2C%20such%20as%20the%20ability%20to%20sign-in%20with%20corporate%2C%20personal%20(hotmail%20or%20xbox)%2C%20or%20even%20Azure%20AD%20guest%20credentials.%20(And%20there's%20a%20bunch%20more).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you're%20doing%20anything%20new%20-%20you%20pretty%20much%20don't%20have%20a%20choice%20but%20to%20use%20V2%20applications.%20And%20that's%20a%20good%20thing.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you're%20supporting%20V1%20apps%20-%20that's%20fine%20too!%20Just%20know%20that%20when%20you%20start%20reading%20about%20the%20functionality%20and%20features%20of%20Azure%20AD%20applications%2C%20you%20need%20to%20know%20which%20version%20you're%20on.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAnd%20which%20SDKs%20you%20can%20use%20depends%20on%20the%20Azure%20AD%20Application%20version%20-%20we'll%20get%20to%20that.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESometimes%20you're%20going%20to%20hear%20about%20V1%20and%20V2%20endpoints.%20Well%2C%20a%20V1%20application%20calls%20V1%20endpoints%20and%20a%20V2%20application%20calls%20V2%20endpoints.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20functionality%20of%20what%20V1%20and%20V2%20applications%20can%20do%20really%20is%20dictated%20by%20the%20endpoints.%3C%2FP%3E%0A%3CP%3ESo%20you'll%20hear%20Azure%20AD%20Application%20and%20Azure%20AD%20Endpoint%20versions%20mentioned%20interchangeably.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20do%20need%20to%20tell%20the%20SDK%20about%20the%20endpoint's%20address.%20And%20there's%20a%20couple%20variations%20of%20that%20(which%20will%20be%20covered%20in%20the%20next%20article).%20But%20know%20that%20you%20don't%20have%20to%20invoke%20it%20directly%20-%20the%20SDK%20will%20take%20care%20of%20that%20for%20you.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAnd%20that%20brings%20us%20to...%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-755231650%22%20id%3D%22toc-hId-755231650%22%20id%3D%22toc-hId-755231650%22%3EThe%20SDKs%3C%2FH3%3E%0A%3CP%3EIf%20the%20various%20different%20types%20of%20Azure%20AD%20Applications%20and%20Endpoints%20and%20the%20terms%20that%20different%20but%20mean%20the%20same%20thing%20didn't%20scare%20you%20off%20-%20wait%20until%20you%20see%20the%20SDKs.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFirst%20off%20-%20the%20SDKs%20are%20Amazing%20with%20a%20capital%20A.%20You%20can%20get%20down%20and%20dirty%20with%20the%20low-level%20specifics%20of%20handling%20authentication%20-%20or%20keep%20it%20nice%20and%20easy.%20Your%20choice.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBut%20with%20choice%20comes...%20confusion%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFirst%20off%20-%20the%20folks%20who%20are%20developing%20the%20SDKs%20are%20awesome%20and%20creating%20them%20for%20all%20types%20of%20platforms.%20iOS%2C%20Android%2C%20.NET%2C%20JavaScript%2C%20even%20Python%20and%20Ruby.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHere's%20what%20you%20need%20to%20know.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThere's%20a%20-ERR%3AREF-NOT-FOUND-library%20called%20ADAL.%20It's%20used%20for%20V1%20applications.%20But...%20You%20don't%20need%20to%20use%20it%20any%20longer.%20It%20still%20works%2C%20but%20if%20you%20can%20transition%20off%20it%2C%20may%20as%20well.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThat's%20because...%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThere's%20-ERR%3AREF-NOT-FOUND-another%20library%20called%20MSAL.%20This%20is%20for%20both%20V1%20and%20V2%20applications.%20It's%20modern.%20Actively%20being%20developed.%20Open-sourced.%20Works%20for%20Azure%20AD%20and%20B2C%20(I%20know%2C%20we%20didn't%20even%20talk%20about%20B2C%20-%20ON%20PURPOSE!).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20can%20get%20low-level%20with%20MSAL%20and%20it'll%20do%20whatever%20you%20need.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22msal_nyt8c0%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F210873iA35B037B2C5EFA0B%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22msal_nyt8c0%22%20alt%3D%22msal_nyt8c0%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBut%20if%20you%20don't%20need%20to%20get%20super%20duper%20low%20level%20(and%20you're%20developing%20web%20apps)...%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThere's%20-ERR%3AREF-NOT-FOUND-yet%20another%20library%20called%20Microsoft.Web.Identity.%20This%20is%20brand%20new%20and%20is%20still%20in%20preview%20at%20the%20time%20I'm%20going%20to%20publish%20this%20article.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20library%20wraps%20a%20%3CEM%3Elot%3C%2FEM%3E%20of%20the%20functionality%20that's%20present%20in%20MSAL%20and%20it%20%3CEM%3Ejust%20works%3C%2FEM%3E%26nbsp%3Bin%20tandem%20with%20ASP.NET%20Core.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThere%20are%20even%20%3CEM%3Edotnet%20new%3C%2FEM%3E%20templates%20for%20it%20that%20install%20the%20appropriate%20NuGets%20and%20boilerplate%20code.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EMicrosoft.Web.Identity%20uses%20MSAL%20under-the-hood.%20It's%20just%20abstracted%20away.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--1052222813%22%20id%3D%22toc-hId--1052222813%22%20id%3D%22toc-hId--1052222813%22%3EThe%20Talk...%3C%2FH3%3E%0A%3CP%3EThat's%20it!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EEverything%20demystified%2C%20right%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAzure%20AD%20is%20amazingly%20powerful%2C%20we%20only%20touched%20the%20tip%20of%20the%20tip%20of%20the%20tip%20of%20the%20iceberg%20here.%20But%20it%20should%20give%20you%20enough%20info%20to%20start%20digging%20into%20the%20documentation%20and%20blogs%20and%20have%20a%20level-set%20of%20what%20they're%20talking%20about.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20not%20-%20and%20you%20have%20questions%20-%20is%20there%20a%20better%20way%20for%20me%20to%20explain%20it%20-%20leave%20a%20comment!%20DM%20me%20on%20Twitter.%20This%20stuff%20can%20be%20confusing%20and%20having%20a%20plain%20'ol%20talk%20is%20the%20best%20way%20to%20lay%20it%20all%20out.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThere's%20going%20to%20be%20a%20couple%20of%20follow-up%20posts%20to%20this%20one.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20first%20will%20be%20creating%20an%20Azure%20AD%20Application%20for%20a%20.NET%20web%20app%20using%20%60Microsoft.Identity.Web%60%20and%20signing%20in.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20next%20will%20be%20gaining%20access%20from%20that%20app%20to%20a%20web%20API.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThen%20use%20a%20SPA%20to%20get%20access%20to%20that%20same%20web%20API.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EUntil%20then...%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1571939%22%20slang%3D%22en-US%22%3E%3CP%3EConfused%20by%20all%20the%20terms%20and%20how%20Azure%20Active%20Directory%20works%20for%20developers%3F%20And%20what's%20the%20Microsoft%20Identity%20Platform%3F%20This%20article%20has%20you%20covered!%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1571939%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20Active%20Directory%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EWeb%20Apps%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1579664%22%20slang%3D%22en-US%22%3ERe%3A%20Let's%20Talk%20About%20Azure%20Active%20Directory%20and%20the%20Microsoft%20Identity%20Platform%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1579664%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F34642%22%20target%3D%22_blank%22%3E%40Matthew%20Levy%3C%2FA%3E%26nbsp%3B-%20thanks%20for%20the%20question!%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20way%20I%20like%20to%20think%20about%20it%20is%20that%20each%20Azure%20AD%20application%20models%20a%20%22real-world%22%20application.%20Each%20AD%20app%20is%20going%20to%20have%20attributes%20specific%20to%20that%20real-world%20application.%20Like%20reply%20url%2C%20client%20secrets%2C%20or%20even%20API%20dependencies.%20(The%20latter%202%20of%20which%20I'll%20get%20into%20in%20a%20subsequent%20article.)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESo%20if%20the%20application%20gets%20deployed%20distinctly%20%2F%20offers%20a%20distinct%20set%20of%20functionality%20...%20then%20it%20probably%20should%20have%20its%20own%20Azure%20AD%20application.%20(Although%20a%20case%20can%20be%20made%20for%20a%20web%20app%20%26amp%3B%20a%20mobile%20app%20to%20share%20the%20same%20AD%20application.)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHope%20that%20helps.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Microsoft

Have you been following along with all the changes in Azure Active Directory (AD)-land and the various Microsoft Identity branded things?

 

(Especially since my epic series on all things Azure AD B2C?)

 

The changes and new features are amazing but change can be confusing. So let's have a little chat about Azure AD and Microsoft Identity.

 

The Quick Tour

 

OK - so I'm going to level with you... the way things are named in Microsoft's Identity Platform is a little bit... well, confusing.

 

I just illustrated my own point - I said Microsoft Identity Platform without introducing it first. What in the world does that even mean?

 

Microsoft uses the term Microsoft Identity Platform as the next evolution to the Azure Active Directory Developer Platform. It's the all encompassing term for building apps with Azure AD.

 

The official Microsoft Identity Platform docs are good. Surprisingly good. But, you still need to know what you're talking about before really grabbing and retaining info from the docs.

 

So let's take the quick tour around Azure AD and Microsoft Identity XXX and try to remove any confusion around process and terms.

 

Azure AD Sign-In Overview

The super high level overview of Azure AD is that it is an Identity Provider (or IdP).

 

It verifies your users are who they say they are - and one way can be by username and password.

After it successfully verifies the user, it returns two tokens. A Token is a Base64 encoded string (also known as a JSON Web Token (JWT), which is just a standard) that has information in it about the user.

 

That info is known as Claims.

 

Think of it as... a user signs in, Azure AD verifies they are who they say they are, and returns 2 tokens full of information that Azure AD claims is true about that user.

 

Oh - and those 2 token flavors? One is known as an Identity token. And the other is an Access token. An Identity token has information about the user. And an Access token is used to gain access to other resources - like a Web API.

 

tokens_nufhfw

 

 

There's more to it than that - but that's the gist. And those are also the standard terms you'll see docs and blogs throw around when talking about signing in users.

 

Communicating with Azure AD

This is where we could get deep, deep into the details - so I'll do my best not to.

 

There are industry standards that Azure AD implements that allow your app to talk to it.

You've probably heard of some of them before - like OpenID Connect or OAuth.

 

For our discussion, these aren't important other than to know Azure AD supports them.

 

Supporting them means somebody else can write an SDK to abstract away all the intricacies of implementing the standard yourself to do the communication. That's a big deal, you don't want to mess up people signing in to your app.

 

Specifically, the sign-in request to Azure AD will be directed at an endpoint. And this is where things get confusing.

 

There used to be v1 endpoints. Now there are v2 endpoints. And you may even hear folks talk about Microsoft Identity Platform endpoints.

 

But endpoints are really a part of Azure AD Applications...

 

 

Azure AD Applications

You can think of an Azure AD Application as a representation of your "real" app in Azure AD.

 

So let's say you had a todo list application. That application has a web app, mobile app, and a web API.

Within Azure AD, you would have 2 applications. One to model the frontend apps. The other to model the web API.

 

Why a separate one to model the web API?

 

This goes back to those access tokens from before.

 

The user of the frontend app will authenticate with Azure AD and get an access token that will be passed to the web API to get access to it.

 

That access is granted by a Scope. It's a portion of the backend's functionality that is scoped out for other application's to use.

 

So through the Azure AD portal, you create (or expose) a scope (or API permission as it will sometimes be called) for the backend's Azure AD Application.

 

Then the frontend application is granted permission to that scope (again through the portal).

 

When the user signs in - they will be asked to Consent to the backend scope being used.

 

If you've ever used your Twitter credentials to signup for an account on another service, you're already familiar with the consent screen. It's the "Application ABCD wants to read your timeline".

 

Your code is responsible for asking for the particular scope needed when signing-in to the frontend. And on the backend, your code is responsible for checking any authorization. Scopes tell you what's going to happen, but leave the implementation details up to you.

 

 

Azure AD Application Types and Endpoints

Ok, to make Azure AD Applications a bit more confusing, there are a bunch of different types of them.

 

V1, V2, and Microsoft Identity Platform applications.

 

To get this out of the way - V2 and Microsoft Identity Platform applications are exactly the same thing. Just a rebranding, if you will.

 

V2 applications are a newer version of Azure AD Applications than V1.

 

They support more functionality, such as the ability to sign-in with corporate, personal (hotmail or xbox), or even Azure AD guest credentials. (And there's a bunch more).

 

If you're doing anything new - you pretty much don't have a choice but to use V2 applications. And that's a good thing.

 

If you're supporting V1 apps - that's fine too! Just know that when you start reading about the functionality and features of Azure AD applications, you need to know which version you're on.

 

And which SDKs you can use depends on the Azure AD Application version - we'll get to that.

 

Sometimes you're going to hear about V1 and V2 endpoints. Well, a V1 application calls V1 endpoints and a V2 application calls V2 endpoints.

 

The functionality of what V1 and V2 applications can do really is dictated by the endpoints.

So you'll hear Azure AD Application and Azure AD Endpoint versions mentioned interchangeably.

 

You do need to tell the SDK about the endpoint's address. And there's a couple variations of that (which will be covered in the next article). But know that you don't have to invoke it directly - the SDK will take care of that for you.

 

And that brings us to...

 

The SDKs

If the various different types of Azure AD Applications and Endpoints and the terms that different but mean the same thing didn't scare you off - wait until you see the SDKs.

 

First off - the SDKs are Amazing with a capital A. You can get down and dirty with the low-level specifics of handling authentication - or keep it nice and easy. Your choice.

 

But with choice comes... confusion?

 

First off - the folks who are developing the SDKs are awesome and creating them for all types of platforms. iOS, Android, .NET, JavaScript, even Python and Ruby.

 

Here's what you need to know.

 

There's a library called ADAL. It's used for V1 applications. But... You don't need to use it any longer. It still works, but if you can transition off it, may as well.

 

That's because...

 

There's another library called MSAL. This is for both V1 and V2 applications. It's modern. Actively being developed. Open-sourced. Works for Azure AD and B2C (I know, we didn't even talk about B2C - ON PURPOSE!).

 

You can get low-level with MSAL and it'll do whatever you need.

 

msal_nyt8c0

 

But if you don't need to get super duper low level (and you're developing web apps)...

 

There's yet another library called Microsoft.Web.Identity. This is brand new and is still in preview at the time I'm going to publish this article.

 

This library wraps a lot of the functionality that's present in MSAL and it just works in tandem with ASP.NET Core.

 

There are even dotnet new templates for it that install the appropriate NuGets and boilerplate code.

 

Microsoft.Web.Identity uses MSAL under-the-hood. It's just abstracted away.

 

The Talk...

That's it!

 

Everything demystified, right?

 

Azure AD is amazingly powerful, we only touched the tip of the tip of the tip of the iceberg here. But it should give you enough info to start digging into the documentation and blogs and have a level-set of what they're talking about.

 

If not - and you have questions - is there a better way for me to explain it - leave a comment! DM me on Twitter. This stuff can be confusing and having a plain 'ol talk is the best way to lay it all out.

 

There's going to be a couple of follow-up posts to this one.

 

The first will be creating an Azure AD Application for a .NET web app using `Microsoft.Identity.Web` and signing in.

 

The next will be gaining access from that app to a web API.

 

Then use a SPA to get access to that same web API.

 

Until then...

 

3 Comments
Occasional Visitor

super useful, thank you for sharing!

Senior Member

Great article. I was following up until the part about front end and back end scope. I understand consent but not sure I understand the reason for the 2 AAD "apps" and the relationship between them.

 

I gather this article is mostly for people developing apps, and not people like me who provide the IdP for those apps, either through gallery apps or custom apps. I leave the endpoints to the developers and they must tell me what to configure on the AAD side.

 

A lot of what I'm doing is transitioning SAML2 apps from ADFS to AAD or adding new OAuth apps to AAD. Also implementing admin consent workflows.

Microsoft

@Matthew Levy - thanks for the question! 

 

The way I like to think about it is that each Azure AD application models a "real-world" application. Each AD app is going to have attributes specific to that real-world application. Like reply url, client secrets, or even API dependencies. (The latter 2 of which I'll get into in a subsequent article.)

 

So if the application gets deployed distinctly / offers a distinct set of functionality ... then it probably should have its own Azure AD application. (Although a case can be made for a web app & a mobile app to share the same AD application.)

 

Hope that helps.