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

  Рет қаралды 23,743

radu dragos

radu dragos

Күн бұрын

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 ай бұрын
Man, you got my respect. I searched for weeks to understand how to integrate and you make it clear in 6 minutes. Thank you!
@61783666
@61783666 6 ай бұрын
Great video, simple and to the point... Good work, and keep it going 🙂
@DieterSoost
@DieterSoost 2 жыл бұрын
Respect ! Very struked and simply explained! ! Great work !
@ondrejtomiska8738
@ondrejtomiska8738 Жыл бұрын
Clearly explained, works almost out of the box. Thank you.
@IncognitoVideosInc
@IncognitoVideosInc Жыл бұрын
Wow awesome video, straight to the point and works. Super helpful, thank you!!!
@lucasfernandesazevedosanto9872
@lucasfernandesazevedosanto9872 2 жыл бұрын
Congratulations and thank you very much! Helped me a lot. 🤝
@tdtdeveloper384
@tdtdeveloper384 2 жыл бұрын
omfg you made my life so much easier tyvm
@sebastianeckley5906
@sebastianeckley5906 9 ай бұрын
Thank You
@ozburun9716
@ozburun9716 4 ай бұрын
Thank you !
@globalfactsforyou
@globalfactsforyou 3 ай бұрын
It is working but I am not able fetch the username nor email post auth, Can you please help me?
@johanneskingma
@johanneskingma Жыл бұрын
A redirect (header) after an echo "..." is not allowed
@mubarakabbas
@mubarakabbas Жыл бұрын
Thanks
@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
@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..
@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
@CarlosLeyes
@CarlosLeyes Жыл бұрын
Hi Radu. I have followed the steps indicated. When doing the login, the Microsoft page never appears requesting the application permissions.
@hakimboudraa246
@hakimboudraa246 Жыл бұрын
same here
@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 Жыл бұрын
all logon securtiy is handled by ms or a federated server. there is no need to do additional captcha's
@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.
@radudragos
@radudragos Жыл бұрын
You don't :)
@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: ..."
@FranciscoMVill
@FranciscoMVill Жыл бұрын
Hi! Is it possible to log out of microsoft from the script? Thanks for the tutorial
@radudragos
@radudragos Жыл бұрын
You redirect the user to this link: login.microsoftonline.com/tenant-id/oauth2/v2.0/logout
@FranciscoMVill
@FranciscoMVill Жыл бұрын
@@radudragos Thanks dude 😁
@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 :)
@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 жыл бұрын
Yes it is possible. Microsoft accepts localhost as a redirect URI.
@dominicgichuhi5822
@dominicgichuhi5822 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 жыл бұрын
Hi, it is either "mail" or "userPrincipalName". However, you can practice your query here: developer.microsoft.com/en-us/graph/graph-explorer
No, Einstein Didn’t Solve the Biggest Problem in Physics
8:04
Sabine Hossenfelder
Рет қаралды 276 М.
Modus males sekolah
00:14
fitrop
Рет қаралды 26 МЛН
Will A Guitar Boat Hold My Weight?
00:20
MrBeast
Рет қаралды 199 МЛН
Nastya and balloon challenge
00:23
Nastya
Рет қаралды 55 МЛН
Sign in with Microsoft Integration with PHP
11:09
myPHPnotes
Рет қаралды 31 М.
Generate a PDF with PHP
19:17
Dave Hollingworth
Рет қаралды 61 М.
UAF / Reference Counting (Wrap up)
55:03
M53
Рет қаралды 41
Github OAuth using PHP (Sign in with Github)
28:23
Keith, the Coder
Рет қаралды 11 М.
Microsoft API - Get Access Token and Refresh Token
6:47
LinuXamination
Рет қаралды 36 М.
PHP REST API From Scratch [1] - Database & Read
32:18
Traversy Media
Рет қаралды 511 М.
ProiectComplet
48:08
radu dragos
Рет қаралды 14 М.
Here's How NVIDA's New 'Eagle Eye' Will Change The World Forever
10:41
Modus males sekolah
00:14
fitrop
Рет қаралды 26 МЛН