Authenticate users in JavaScript apps with MSAL.js

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 พ.ย. 2024

ความคิดเห็น • 56

  • @goelliego
    @goelliego 4 ปีที่แล้ว +8

    Really Liked the manual method to explain slowly for beginners. Best tutorial so far on the getting started with the topic.

  • @Terry-404
    @Terry-404 4 ปีที่แล้ว +17

    Lol - that "header" typo had me screaming at the screen "It's right there!"

    • @jaimemnds
      @jaimemnds 3 ปีที่แล้ว +1

      DAMN HEADES

    • @gimperdaniel
      @gimperdaniel 3 ปีที่แล้ว +1

      this always happens when you are a presenter

    • @sidney-andrews
      @sidney-andrews 3 ปีที่แล้ว

      Yea, it stressed me out looking back

  • @Ziggy0120
    @Ziggy0120 2 ปีที่แล้ว +1

    this is an excellent video! I have to implement authentication using azure for a work project without ever having done it before. thank you!

  • @vish86in
    @vish86in 4 ปีที่แล้ว +2

    Great video!! waiting for Authenticating to Azure with MSAL.js

  • @itsmeinspiron
    @itsmeinspiron 3 ปีที่แล้ว +2

    Thank you for this walk through, very easy to digest - great job Sidney!

  • @briancoder7621
    @briancoder7621 3 ปีที่แล้ว +1

    Excellent tutorial. MSAL is very useful. Thank you.

  • @tushaar9027
    @tushaar9027 2 ปีที่แล้ว +1

    Excellent tutorial , can you please show using pkce as well as it is going to be become standard pretty soon

  • @agamesta4
    @agamesta4 3 ปีที่แล้ว

    thank you very much , it work with me after more time in search

  • @KlrStng
    @KlrStng 3 ปีที่แล้ว

    Thank you for this video, it is helpful. As of 1/26/21, the manual step to acquire a token (at ~28:00) now requires the client secret as well as the client id and the code.

    • @MicrosoftDevRadio
      @MicrosoftDevRadio  3 ปีที่แล้ว +3

      Thanks for calling that out. We'll have to do a refresh of this video in the not too distant future. Appreciate the help keeping up with the changes in Azure!

    • @carloolleres5237
      @carloolleres5237 3 ปีที่แล้ว

      I did create an application secret for the specific application however I'm receiving a Request malformed error

    • @sidney-andrews
      @sidney-andrews 3 ปีที่แล้ว +1

      Moving forward, I would recommend using MSAL 2x which doesn’t require the secret or implicit grant.

  • @thingsiwishiknew8592
    @thingsiwishiknew8592 ปีที่แล้ว

    Hi there love the video , quick question, how would this change if i wanted to use a certificate instead of a secret

  • @jasonthorpe3470
    @jasonthorpe3470 2 ปีที่แล้ว +1

    Great Stuff! I have a request though, Can you post links to the other videos in this series in the description?

    • @MicrosoftDevRadio
      @MicrosoftDevRadio  2 ปีที่แล้ว +1

      thanks for calling that out. I've added a link to the complete playlist

  • @PatrickSierak
    @PatrickSierak 4 ปีที่แล้ว +2

    Thank you for this video :)

  • @aashayamballi
    @aashayamballi 3 ปีที่แล้ว +2

    Thanks for the great demo. I just had one question. If I have a single page app or a native app and a backend API (django rest) completely independen of each other. In my case if my single page app/native apl wants to access certain data from backend API. And inorder to access the API, user should be logged in the backend API.
    So what my approch is to make use of MSAL library to get the access token from the SPA/native app and then once token is acquired, pass that token to backend API, validate it, get the user info from graph api, if user is exists in the DB login the user and pass the required info. If user info doesn't exist then create the user, login and pass the info from API.
    So my question is when I pass the access token to backend api. How can we validate that the token which we passed to backend API is valid token or not?
    Is it just we need to make an API call to graph API? if it is able to get the user data then token is valid or if it fails then the token is invalid.
    Is it the general way to validate the token or some better approach is there? Please help

    • @sidney-andrews
      @sidney-andrews 3 ปีที่แล้ว +1

      Yes, you should look at the “on-behalf-of” workflow for the API: docs.microsoft.com/en-us/azure/active-directory/develop/msal-authentication-flows#on-behalf-of
      Basic idea is to perform an interactive workflow on the front-end, then pass in your token as a bearer token to the back-end. The API can then use your token to get its own token on behalf of you, the user.

    • @_boraprogramar
      @_boraprogramar ปีที่แล้ว

      Do you manage to do that way? I'm trying to do The same

  • @GapBruno360
    @GapBruno360 3 ปีที่แล้ว

    This is great, thank you!

  • @carloolleres5237
    @carloolleres5237 3 ปีที่แล้ว +1

    Hi, I'm faced with an error of URL Malformed even after providing a Client Secret to the form data sent at the tutorial time 28:00, anybody experienced the same error?

  • @kanakarajunaiduthota2417
    @kanakarajunaiduthota2417 3 ปีที่แล้ว

    can we create or update SharePoint list item using MSAL who have read-only access on the SharePoint?

  • @cleanbowledyt
    @cleanbowledyt 2 ปีที่แล้ว

    great tutorial...thanks for this one....however is there any api that would help me to logout the signed in user
    Please share the same if you happen to know about it

  • @randompointlessness2766
    @randompointlessness2766 3 ปีที่แล้ว

    I ve been using adal.js but since we migrate to .net 5.0 it gives me errFailed while on microsoft authentication page redirection won't work so I assume I have to use MSAL.js

  • @pawelpisarski4740
    @pawelpisarski4740 4 ปีที่แล้ว +1

    Great tutorial! When are the other parts of this series going to be available?

    • @sidney-andrews
      @sidney-andrews 4 ปีที่แล้ว

      There are more videos on the channel now

  • @harsh21289
    @harsh21289 4 ปีที่แล้ว +1

    Great video.. thanks!!

  • @jlumley
    @jlumley ปีที่แล้ว

    does this work if your app is in an .

  • @dvijhay78
    @dvijhay78 4 ปีที่แล้ว

    How do you get data from Sharepoint lists using msal.js, do you have any tutorials.

  • @ashishnarkhede3637
    @ashishnarkhede3637 4 ปีที่แล้ว

    The slide at 23.04 shows that the refresh token is supposed to be in the response. But in the Postman demo at 28.16, there is no refresh token? Was it a typo in the slide?

    • @sidney-andrews
      @sidney-andrews 4 ปีที่แล้ว

      Yes, thanks for calling that out

  • @gmil12345
    @gmil12345 2 ปีที่แล้ว

    contrary to what this video says there doesn't appear to be anyone answering emails to the address advised... which is a real shame as as soon as you try to do anything not out-the-box with B2C it's like walking in treacle

    • @MicrosoftDevRadio
      @MicrosoftDevRadio  2 ปีที่แล้ว

      Feel free to send me mail directly at macalde@microsoft.com if you're not getting through using msusdev@microsoft.com

  • @verplife6137
    @verplife6137 3 ปีที่แล้ว

    To me, there is nothing worse than seeing a microsoft sign in page knowing the user will not know what that is and be confused because all they want to do is log into my site. I would get so many calls, if I implemented this on my company page, regarding if they have been hacked or went to the wrong site, etc. This is a deal breaker for me.

    • @sidney-andrews
      @sidney-andrews 3 ปีที่แล้ว +1

      You can apply custom branding to the sign-in page. It’s pretty in-depth and you can change a lot of components. Azure AD B2C takes it further by supporting custom CSS.
      But one note that trips everyone up: If you redirect people to the “common” tenant, you will get default Microsoft branding because Azure AD doesn’t know if you are going to use an org or personal account. If you redirect to the “organizations” tenant, Azure AD can make educated guesses, but it still won’t apply corp branding because it doesn’t know which org the user will select. Redirect users directly to your tenant using your GUID so users will see your branding immediately and won’t be confused by the Microsoft branding.

  • @danielbenedik4659
    @danielbenedik4659 2 ปีที่แล้ว

    this is SSO connection with Azure?

  • @oyinbrakemimichaelmenebray5966
    @oyinbrakemimichaelmenebray5966 2 ปีที่แล้ว

    Is it possible to get the user profile with out clicking the button.
    Please help, because I'm trying to get the user information using the on compose message event handler.

    • @MicrosoftDevRadio
      @MicrosoftDevRadio  2 ปีที่แล้ว +1

      Feel free to send mail to msusdev@microsoft.com and we'll try to help

    • @oyinbrakemimichaelmenebray5966
      @oyinbrakemimichaelmenebray5966 2 ปีที่แล้ว

      @@MicrosoftDevRadio thanks, I'll do that now. Hoping to get a feedback soon

    • @MicrosoftDevRadio
      @MicrosoftDevRadio  2 ปีที่แล้ว +1

      @@oyinbrakemimichaelmenebray5966 I haven't seen the mail come through, just fyi.

    • @oyinbrakemimichaelmenebray5966
      @oyinbrakemimichaelmenebray5966 2 ปีที่แล้ว

      I sent the mail immediately after I replied your message

    • @oyinbrakemimichaelmenebray5966
      @oyinbrakemimichaelmenebray5966 2 ปีที่แล้ว

      I sent the email with my outlook account.
      Can you please check your spam messages.
      Thanks

  • @nagacse66
    @nagacse66 3 ปีที่แล้ว

    Msal refreshtoken method not working consistent

  • @nikhilramabhadra6052
    @nikhilramabhadra6052 3 ปีที่แล้ว

    Is it possible to avoid the content in the index.js file client I'd etc? Everything is in plain text. This information will be seen in the browser dev tools by anybody. Am I right? It doesn't feel right.
    Is it not possible to have the login page served from the server and then have the React app load?

    • @sidney-andrews
      @sidney-andrews 3 ปีที่แล้ว +1

      The OAuth spec says that the client ID is not a secret so you shouldn’t worry about storing that in plain text: tools.ietf.org/html/rfc6749#section-2.2
      However, client secrets and credentials should absolutely be secured.

    • @sidney-andrews
      @sidney-andrews 3 ปีที่แล้ว +1

      For some additional context, information like the authority, scope, and client ID are present in the URL when you login as plain text. None of it is a secret, and none of it is enough for someone to get access to your system.
      If it’s an interactive login, they still need to login on the webpage (username+password, or device). In an unattended scenario, they still need a secret or certificate (which you should absolutely secure).
      Does that explanation help?

    • @nikhilramabhadra6052
      @nikhilramabhadra6052 3 ปีที่แล้ว

      @@sidney-andrews Isn't the AAD URL present in JavaScript an issue? DOS attack on AAD?

    • @sidney-andrews
      @sidney-andrews 3 ปีที่แล้ว

      @@nikhilramabhadra6052 Azure has DDOS protection already integrated into services on the platform.
      There is a separate paid service if you want DDOS for applications you built.

    • @nikhilramabhadra6052
      @nikhilramabhadra6052 3 ปีที่แล้ว

      @@sidney-andrews After ChaosDb, Azurescape, and such issues how much faith do you have in MS DDOS protection? 🤔

  • @diptanu.saha.knightKing
    @diptanu.saha.knightKing 3 ปีที่แล้ว

    How to make mgt components work on top of this - can anyone help ?

    • @sidney-andrews
      @sidney-andrews 3 ปีที่แล้ว

      We just released a video on the MGT components today on this channel