Authentication By MSAL Flashcards

(16 cards)

1
Q

What is MSAL?

A
  • Microsoft authentication library
  • enables Devs to acquire security tokens from MIP to authenticate users and access secured web APIs
  • can be used to provide access to MS graph, other MS APIs, 3rd party APIs or own web API
  • Supports .NET, JS, Java, Python
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What benefits does MSAL provide?

A
  • No need to directly use Oauth libraries or code against the protocol in your app
  • Acquires tokens on behalf of user or on behalf of an app
  • Maintains a token cache and refreshes tokens for you when theyre close to expire
  • helps specify which audience you want your app to sign-in
  • helps you set up your app from config files
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Where can MSAL acquire tokens from?

A
  • web apps
  • web APIs
  • SPAs
  • mobile and native apps
  • Daemons and service side apps
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the names of the the MSAL auth flows?

A
  • Authorization code
  • Client credentials
  • Device code
  • Implicit grant
  • On behalf Of
  • Username/password
  • Integrated windows Auth
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is authorization Code MSAL flow?

A

User sign-in and access to web APIs on half of user, supported on desktop SPs mobile and web

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is client credentials MSAL flow?

A

Access to web APIs by using ID of the app itself, used for server-server communication and automated scripts requiring no user interaction (azure functions)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is device code MSAL flow?

A
  • user sign-in and access to web APIs on behalf of user on Input-constrained devices like smart TVs and CLIs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is implicit grant MSAL flow?

A

User sign-in and access to web APIs on behalf of user supported on SPAs and web apps

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is On Behalf Of MSAL flow?

A
  • Access from an upstream web API to a downstream web API on behalf of user
  • users ID and delegated perms are passed through to downstream API
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is integrated windows auth MSAL flow?

A

Allows apps on domain or Entra joined computer to acquire a token silently without UI interaction

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a client in relation to MSAL?

A
  • Software entity that has a unique ID assigned by an ID provider
  • MSAL defines both public and confidential clients
  • Client types differ on their ability to authenticate securely with the authorisation server and to hold sensitive ID proving info so that it cant be accessed or known to a user within scope of its access
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are MSAL public client apps?

A
  • Run on devices such as desktop, browserless APIs, mobile or client side browser apps
  • cant be trusted to safely keep app secrets so they can only access web APIs on behalf of user
  • cant have client secrets
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are MSAL confidential client apps?

A
  • Run on servers such as web apps, web API apps or service/daemon apps
  • considered difficult to access by users or attackers and therefore can adequately hold config time secrets to assert proof of ID
  • Client ID is exposed through the web browser but the secret is passed only in back channel and never directly exposed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the recommended way to initialise an app with MSAL? What will we need to provide?

A
  • App builders “PublicClientApplicationBuilder” and “ConfidentialClientApplicationBuilder”
  • App ID, directory tenant ID, authority, client credentials and any potential redirect URI
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are common modifiers to public and confidential client apps?

A

.WithAuthority
.WithTenantID
.WithClientId
.WithRedirectUri
.WithComponent
.WithDebugLoggingCallback
.WithLogging
.WithTelemetry

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are modifiers specific to confidential client apps?

A

.WithCertificate
.WithClientSecret