How to do single auth for multiple projects in laravel? The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) The Ask Question Wizard is Live! Data science time! April 2019 and salary with experienceSPA best practices for authentication and session managementWhere to store JWT in browser? How to protect against CSRF?Can Jwt-Auth in laravel handle invalidated tokens in a multi server configuration?Using JWT Auth along with existing authenticatiion systemJWT vs cookies for token-based authenticationIs it ok to use Laravel Auth in react or vue?Laravel Passport vs JWT-auth for AndroidLaravel > 5.5 sessions and APILaravel 5.6 - Passport JWT httponly cookie SPA authentication for self consuming API?Is there any benefit for storing JWT in both a cookie and local storage?

How can I protect witches in combat who wear limited clothing?

How do you keep chess fun when your opponent constantly beats you?

First use of “packing” as in carrying a gun

Can undead you have reanimated wait inside a portable hole?

How to copy the contents of all files with a certain name into a new file?

Why can't devices on different VLANs, but on the same subnet, communicate?

University's motivation for having tenure-track positions

Can the DM override racial traits?

How to pronounce 1ターン?

Difference between "generating set" and free product?

Did the new image of black hole confirm the general theory of relativity?

Take groceries in checked luggage

Wall plug outlet change

What's the point in a preamp?

Would an alien lifeform be able to achieve space travel if lacking in vision?

Am I ethically obligated to go into work on an off day if the reason is sudden?

What do you call a plan that's an alternative plan in case your initial plan fails?

Does Parliament hold absolute power in the UK?

Mortgage adviser recommends a longer term than necessary combined with overpayments

Do working physicists consider Newtonian mechanics to be "falsified"?

The following signatures were invalid: EXPKEYSIG 1397BC53640DB551

Working through the single responsibility principle (SRP) in Python when calls are expensive

Typeface like Times New Roman but with "tied" percent sign

Is this wall load bearing? Blueprints and photos attached



How to do single auth for multiple projects in laravel?



The 2019 Stack Overflow Developer Survey Results Are In
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
The Ask Question Wizard is Live!
Data science time! April 2019 and salary with experienceSPA best practices for authentication and session managementWhere to store JWT in browser? How to protect against CSRF?Can Jwt-Auth in laravel handle invalidated tokens in a multi server configuration?Using JWT Auth along with existing authenticatiion systemJWT vs cookies for token-based authenticationIs it ok to use Laravel Auth in react or vue?Laravel Passport vs JWT-auth for AndroidLaravel > 5.5 sessions and APILaravel 5.6 - Passport JWT httponly cookie SPA authentication for self consuming API?Is there any benefit for storing JWT in both a cookie and local storage?



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















I have 2 projects under development: blog and shop. These projects will be stored on different servers, but authentication must be the same for all these projects and it should be on server side (with sessions and csrf, not js api calls for authentication with jwt token or smth else). Auth endpoints will be in the shop project. For shop project it will be easy to make an default laravel auth, but how to share it to the blog project?



I guess I need to make an middleware which will send an request to the shop server with client cookies, but I'm stuck in this problem. Any ideas?










share|improve this question




























    1















    I have 2 projects under development: blog and shop. These projects will be stored on different servers, but authentication must be the same for all these projects and it should be on server side (with sessions and csrf, not js api calls for authentication with jwt token or smth else). Auth endpoints will be in the shop project. For shop project it will be easy to make an default laravel auth, but how to share it to the blog project?



    I guess I need to make an middleware which will send an request to the shop server with client cookies, but I'm stuck in this problem. Any ideas?










    share|improve this question
























      1












      1








      1


      0






      I have 2 projects under development: blog and shop. These projects will be stored on different servers, but authentication must be the same for all these projects and it should be on server side (with sessions and csrf, not js api calls for authentication with jwt token or smth else). Auth endpoints will be in the shop project. For shop project it will be easy to make an default laravel auth, but how to share it to the blog project?



      I guess I need to make an middleware which will send an request to the shop server with client cookies, but I'm stuck in this problem. Any ideas?










      share|improve this question














      I have 2 projects under development: blog and shop. These projects will be stored on different servers, but authentication must be the same for all these projects and it should be on server side (with sessions and csrf, not js api calls for authentication with jwt token or smth else). Auth endpoints will be in the shop project. For shop project it will be easy to make an default laravel auth, but how to share it to the blog project?



      I guess I need to make an middleware which will send an request to the shop server with client cookies, but I'm stuck in this problem. Any ideas?







      laravel authentication






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 8 at 13:35









      AlexxosipovAlexxosipov

      212316




      212316






















          1 Answer
          1






          active

          oldest

          votes


















          1














          You should create a different app, an oauth2 server, which authenticates the users for both sites.






          share|improve this answer























          • Yes, I understand that I am moving to microservices. I don't understand how to authorize users on laravel side using oauth2 server? Should it be the httpOnly cookie with auth token and when user send a request to the blog server, blog server will send a request to the oauth server with this cookie?

            – Alexxosipov
            Mar 8 at 13:53












          • There is a very good article with the details on how to implement this: blog.pusher.com/make-an-oauth2-server-using-laravel-passport

            – Zoli
            Mar 8 at 13:56











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55064324%2fhow-to-do-single-auth-for-multiple-projects-in-laravel%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          You should create a different app, an oauth2 server, which authenticates the users for both sites.






          share|improve this answer























          • Yes, I understand that I am moving to microservices. I don't understand how to authorize users on laravel side using oauth2 server? Should it be the httpOnly cookie with auth token and when user send a request to the blog server, blog server will send a request to the oauth server with this cookie?

            – Alexxosipov
            Mar 8 at 13:53












          • There is a very good article with the details on how to implement this: blog.pusher.com/make-an-oauth2-server-using-laravel-passport

            – Zoli
            Mar 8 at 13:56















          1














          You should create a different app, an oauth2 server, which authenticates the users for both sites.






          share|improve this answer























          • Yes, I understand that I am moving to microservices. I don't understand how to authorize users on laravel side using oauth2 server? Should it be the httpOnly cookie with auth token and when user send a request to the blog server, blog server will send a request to the oauth server with this cookie?

            – Alexxosipov
            Mar 8 at 13:53












          • There is a very good article with the details on how to implement this: blog.pusher.com/make-an-oauth2-server-using-laravel-passport

            – Zoli
            Mar 8 at 13:56













          1












          1








          1







          You should create a different app, an oauth2 server, which authenticates the users for both sites.






          share|improve this answer













          You should create a different app, an oauth2 server, which authenticates the users for both sites.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 8 at 13:48









          ZoliZoli

          596420




          596420












          • Yes, I understand that I am moving to microservices. I don't understand how to authorize users on laravel side using oauth2 server? Should it be the httpOnly cookie with auth token and when user send a request to the blog server, blog server will send a request to the oauth server with this cookie?

            – Alexxosipov
            Mar 8 at 13:53












          • There is a very good article with the details on how to implement this: blog.pusher.com/make-an-oauth2-server-using-laravel-passport

            – Zoli
            Mar 8 at 13:56

















          • Yes, I understand that I am moving to microservices. I don't understand how to authorize users on laravel side using oauth2 server? Should it be the httpOnly cookie with auth token and when user send a request to the blog server, blog server will send a request to the oauth server with this cookie?

            – Alexxosipov
            Mar 8 at 13:53












          • There is a very good article with the details on how to implement this: blog.pusher.com/make-an-oauth2-server-using-laravel-passport

            – Zoli
            Mar 8 at 13:56
















          Yes, I understand that I am moving to microservices. I don't understand how to authorize users on laravel side using oauth2 server? Should it be the httpOnly cookie with auth token and when user send a request to the blog server, blog server will send a request to the oauth server with this cookie?

          – Alexxosipov
          Mar 8 at 13:53






          Yes, I understand that I am moving to microservices. I don't understand how to authorize users on laravel side using oauth2 server? Should it be the httpOnly cookie with auth token and when user send a request to the blog server, blog server will send a request to the oauth server with this cookie?

          – Alexxosipov
          Mar 8 at 13:53














          There is a very good article with the details on how to implement this: blog.pusher.com/make-an-oauth2-server-using-laravel-passport

          – Zoli
          Mar 8 at 13:56





          There is a very good article with the details on how to implement this: blog.pusher.com/make-an-oauth2-server-using-laravel-passport

          – Zoli
          Mar 8 at 13:56



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55064324%2fhow-to-do-single-auth-for-multiple-projects-in-laravel%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          1928 у кіно

          Захаров Федір Захарович

          Ель Греко