Azure Tutorial | Login Using Microsoft Azure Active Directory And PHP | Single Sign On ( SSO )

Поділитися
Вставка
  • Опубліковано 18 вер 2024
  • Download Whole API with Composed Repository (Only for PHP v7.2 & Plus):-
    unpossiblepog....
    Source Code :-
    github.com/mag...
    How to install XAMPP in LINUX (Debian family) :-
    • LUBUNTU : Install, Lau...
    for php 7, run command :-
    apt-get install php-curl
    for php 5, run command :-
    apt-get install php5-curl
    Add new array in INDEX :-
    return_url
    open composer.json & paste code :-
    {
    "require": {
    "taxjar/taxjar-php": "^1.8",
    "magium/active-directory": "^1.1"
    }
    }
    ------------------------------------------------
    Subscribe my Channel:-
    www.youtube.com...
    Facebook Page:-
    / unpossiblens
    Twitter Account:-
    / unpossiblepog
    Blog :-
    unpossiblepog....
    ------------------------------------------------
    Hey guys, this is UNPOSSIBLE POG.
    In this video, I shall make a connection between microsoft azure and PHP, in short, an authentication using microsoft account through cloud service.
    This service is one of the type of “Software as a service” that is SaaS.
    As you know, microsoft Azure is a of the cloud-service provider where you can store your data, use it, execute it.
    We are using AZURE to authenticate user’s account on their servers rather than our own server or computer.
    What do I mean by that?
    Suppose you have a website called www.xyz.com, than rather than creating your own login form, you can use microsoft’s login page. So what are the advantage?
    Some of them are,
    1, if you create your own login page, then it may have loopholes from where hackers can hack into your website. (Loophole maybe like sql injection, bruteforce login)
    2, your code can validate email pattern but can not identify if they are real or not. For example if an intruder whats to access your service, then he can create add an email like random-person123@hammer.com which has same pattern as any email but may not exists in real world.
    There are many more, but lets skip that for now.
    Lets get started.
    Go to portal.azure.com
    If you are using trial version, then click on “skip for now”
    From top menu, click on “Azure active directory”
    Click on App registration.
    Click on “New registration”
    Type any random name that you want for application.
    Make sure to select Multi tenant (tenant = users) with personal microsoft account.
    Platform is optional.
    Click on REGISTER.
    Now scroll down, and make select on “YES” on “Treat application as a public client”, and save it.
    Then again, click on TOP MENU, “AZURE ACTIVE DIRECTORY”, then select the application we created.
    Make sure to copy “APPLICATION (CLIENT) ID”, we need that later on.
    Then click on “ADD a Redirect URI”.
    You came back to same page of configuration.
    Now click on “Add a platform”, and select “WEB”.
    Now, I have one website with HTTPS enabled.
    For now I shall use that link as redirect URL.
    Make sure to tick “Access tokens” and “ID tokens” checked, and click on configure.
    Now click on “Certificates and Secrets”,"New Client Secret”, add random description.
    Click on “Add”.
    For PHP part, you can see the video.
    Required links are given in the description.
    Thanks for watching.
    Don’t forget to like, share and subscribe.

КОМЕНТАРІ • 23

  • @CesarBielich
    @CesarBielich 3 роки тому +1

    Nice Video man, that was way to easy!

  • @sikandernawaz2838
    @sikandernawaz2838 3 роки тому +1

    Amazing work bro, Made it so easy

  • @danishshaikh824
    @danishshaikh824 4 роки тому

    Nice video.

  • @bradleyhack8235
    @bradleyhack8235 4 роки тому +1

    Excellent tutorial.
    How would you logout of your app here?

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

    i got an error (does not match the expected Json schema) how to resolved it please reply me

  • @mr_don_key
    @mr_don_key 3 роки тому +3

    magium is deprecated, use with utmost care.

  • @rajasekhararamulu2601
    @rajasekhararamulu2601 3 роки тому

    Can't I enable SSO for plain PHP8 application (Developed without any framework) which is hosted in Azure VM ?

  • @fernandomonarca8270
    @fernandomonarca8270 3 роки тому

    Thanks, and the logout?

  • @s2003katalin
    @s2003katalin 4 роки тому

    Why is taxjar/taxjar-php required ??

    • @UnpossiblePOG
      @UnpossiblePOG  4 роки тому

      I attempted "AZURE SSO" two days before making this tutorial. And while executing composer.json, terminal was giving me errors like "PROBLEM 1....", "PROBLEM 2...." (as you can see at 7:09), when I was searching for those problems on the internet, I read one article which says 'you have to add other "libraries" in order to install it'. So I including that in tutorial. I don't know the purpose of it to be honest because they are API. We, as a developer, don't have to know how they work, we just have to make it work. :)

    • @s2003katalin
      @s2003katalin 4 роки тому +1

      Unpossible POG Oh wow! You go ahead and import code you don’t know. There are questions you should have an answer for, as a developer. Questions such as "What will happen if that piece of code, I didn’t write and don’t understand, has vulnerabilities?". Don’t get me wrong but no, we, as developers, should understand what the code we write AND import does. It’s your responsibility. Tomorrow, with this way of thinking, your application where you import things willy billy could get compromised and data of your users stolen. Who’s responsibility would that be?

    • @UnpossiblePOG
      @UnpossiblePOG  4 роки тому

      @@s2003katalin You are not wrong. But we are taking about "Microsoft Azure" here, whatever security is, is provided by Microsoft itself. Plus there is a team in corporate called "Cyber security Security / Ethical hackers" whose job is to find loopholes. I mean why Microsoft will share non-secured modules for public anyways?

    • @s2003katalin
      @s2003katalin 4 роки тому

      Unpossible POG Well, you see, that’s the thing. We’re talking about taxjar-php which is NOT a Microsoft developed package and has nothing to do with Azure.
      Anyway, if I have some time, I’ll look into these errors you get and see how to avoid installing it.

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

    why can't i run composer?

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

      "./composer.json" does not match the expected JSON schema:
      - name : Does not match the regex pattern ^[a-z0-9]([_.-]?[a-z0-9]+)*/[a-z
      0-9](([_.]?|-{0,2})[a-z0-9]+)*$

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

      Which Operating system do you have? Use windows 10. And make sure to update the operating system.

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

    I am getting this error any help? The return URL is fine and I am trying in private mode. I was able to log in but while returning this error is seen:
    Stack trace:
    #0 /home/wp4/public_html/abc/active-directory-develop/vendor/league/oauth2-client/src/Provider/AbstractProvider.php(644): League\OAuth2\Client\Provider\GenericProvider->checkResponse(Object(GuzzleHttp\Psr7\Response), Array)
    #1 /home/wp4/public_html/abc/active-directory-develop/vendor/league/oauth2-client/src/Provider/AbstractProvider.php(560): League\OAuth2\Client\Provider\AbstractProvider->getResponse(Object(GuzzleHttp\Psr7\Request))
    #2 /home/wp4/public_html/abc/active-directory-develop/src/Delegates/Receive.php(81): League\OAuth2\Client\Provider\AbstractProvider->getAccessToken(Object(League\OAuth2\Client\Grant\AuthorizationCode), Array)
    #3 /home/wp4/public_html/abc/active-directory-develop/src/ActiveDirectory.php(179): Magium\ActiveDirectory\Delegates\Receive->execute()
    #4 /home/wp4/public_html/abc/active-directory-develop/examples/server/index.php(26): Magium\ActiveDirectory\ActiveDirectory->authenticate()
    #5 {main}
    thrown in /home/wp4/public_html/abc/active-directory-develop/vendor/league/oauth2-client/src/Provider/GenericProvider.php on line 216

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

      Is it a wordpress?

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

      @@UnpossiblePOG Yes it is wordpress

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

      @@SauravAdhikariwp first try it using core-php. I was also facing the problem when i was implementing it in codeigniter.

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

      @@UnpossiblePOG I am trying it on my root folder. I am not inserting these codes inside the WordPress folder. I have done what you have shown and uploaded the folder directly to my root. The folder has been uploaded to the root folder and outside wp-content.