PHP Web authenticate on Microsoft with OAuth 2.0 using GET and POST

Поділитися
Вставка
  • Опубліковано 18 вер 2024
  • MS AD Application Registration
    portal.azure.c...
    PHP Source code for GET:
    docs.google.co...
    PHP Source code for POST:
    docs.google.co...

КОМЕНТАРІ • 38

  • @paltonlimaalves1754
    @paltonlimaalves1754 11 місяців тому +3

    Man, you got my respect. I searched for weeks to understand how to integrate and you make it clear in 6 minutes. Thank you!

  • @DieterSoost
    @DieterSoost 2 роки тому +5

    Respect ! Very struked and simply explained! ! Great work !

  • @61783666
    @61783666 6 місяців тому +1

    Great video, simple and to the point... Good work, and keep it going 🙂

  • @ondrejtomiska8738
    @ondrejtomiska8738 Рік тому +1

    Clearly explained, works almost out of the box. Thank you.

  • @IncognitoVideosInc
    @IncognitoVideosInc Рік тому +1

    Wow awesome video, straight to the point and works. Super helpful, thank you!!!

  • @lucasfernandesazevedosanto9872
    @lucasfernandesazevedosanto9872 2 роки тому +1

    Congratulations and thank you very much! Helped me a lot. 🤝

  • @tdtdeveloper384
    @tdtdeveloper384 2 роки тому +1

    omfg you made my life so much easier tyvm

  • @sebastianeckley5906
    @sebastianeckley5906 9 місяців тому +1

    Thank You

  • @ozburun9716
    @ozburun9716 4 місяці тому +1

    Thank you !

  • @mubarakabbas
    @mubarakabbas Рік тому +2

    Thanks

  • @johanneskingma
    @johanneskingma Рік тому

    A redirect (header) after an echo "..." is not allowed

  • @theacher20019
    @theacher20019 Рік тому

    hola estoy probando, y alñogueo pero no puedo obtener el token para hacer peticiones curl alguien sabrá como lo obtengo ya aparéese el name y log out

  • @globalfactsforyou
    @globalfactsforyou 3 місяці тому

    It is working but I am not able fetch the username nor email post auth, Can you please help me?

  • @IncognitoVideosInc
    @IncognitoVideosInc Рік тому

    Do you know if it is best practice to place a captcha before allowing sign-in link to be followed? Or is Microsoft handling this on their login?

    • @johanneskingma
      @johanneskingma Рік тому +1

      all logon securtiy is handled by ms or a federated server. there is no need to do additional captcha's

  • @lokeshdas2585
    @lokeshdas2585 2 роки тому

    Error: specified in the request does not match the redirect URIs configured for the application due to http_build_query() function

    • @radudragos
      @radudragos  Рік тому

      Make sure your redirect_uri in the code matches the one registered in Azure AD for this app..

  • @FranciscoMVill
    @FranciscoMVill Рік тому +1

    Hi! Is it possible to log out of microsoft from the script? Thanks for the tutorial

    • @radudragos
      @radudragos  Рік тому +2

      You redirect the user to this link: login.microsoftonline.com/tenant-id/oauth2/v2.0/logout

    • @FranciscoMVill
      @FranciscoMVill Рік тому

      @@radudragos Thanks dude 😁

  • @MarkS-fc6bf
    @MarkS-fc6bf Рік тому

    I registered my web application at Microsoft Azure and tried several settings. I have done a lot of research that allows me to connect to the mailbox to be able to read the mails without going through an interaction with a user. I've found nothing.
    Does anyone have a step-by-step solution.

    • @radudragos
      @radudragos  Рік тому

      You can use Microsoft Graph API. And you can practice here: developer.microsoft.com/en-us/graph/graph-explorer

  • @tszima77
    @tszima77 Рік тому

    Why do I have to set the $secret variable, if the script doesn't use it? I didn't see it in the php scripts.

  • @CarlosLeyes
    @CarlosLeyes Рік тому

    Hi Radu. I have followed the steps indicated. When doing the login, the Microsoft page never appears requesting the application permissions.

  • @MarkS-fc6bf
    @MarkS-fc6bf Рік тому

    Hi Radu, I'm getting this error Warning: Cannot modify header information - headers already sent by (output started at on line 41) Can u please help on me

    • @radudragos
      @radudragos  Рік тому

      It's just a warning. Hit refresh or change code so there is no echo output before any "header ('Location: ..."

  • @LeszekMaj
    @LeszekMaj Рік тому

    Your code is great but I don't know why you declare variable
    $secret but you don't use it ? Second my question is after login my token is expired only 1 hour how add refresh_token?

    • @radudragos
      @radudragos  Рік тому

      That $secret is a leftover, its not needed. The refresh_token is a topic for another tutorial for which I didn't have time yet :)

  • @dominicgichuhi5822
    @dominicgichuhi5822 2 роки тому +2

    Hi, thanks for the tutorial. It works well. How can I get the email instead of the name. What parameter should I put in $_SESSION["uname"] to get the email?

    • @radudragos
      @radudragos  2 роки тому +1

      Hi, it is either "mail" or "userPrincipalName". However, you can practice your query here: developer.microsoft.com/en-us/graph/graph-explorer

  • @rodarape1
    @rodarape1 2 роки тому

    hi, i have this error: CompactToken parsing failed with error code: 80049217 after this line: $rez = json_decode(curl_exec($ch), 1);
    please help

    • @erick639
      @erick639 Рік тому

      HOla amigo! al final te funcionó el código?

  • @bsungur
    @bsungur 2 роки тому

    Hello redu, is it possible run it in our localhost?

    • @radudragos
      @radudragos  2 роки тому +2

      Yes it is possible. Microsoft accepts localhost as a redirect URI.