0

First of all, i am very new to Laravel and Azure and i am not very sure what i am doing.

I want to add Authentication to my Laravel Web Application.

I followed the instructions in this Link to do that:

When i press my Login Button, which leeds me to "/login/azure" i get directed to

https://login.microsoftonline.com/ef7e48cb-7676-47e9-9a28-c69910d92560/oauth2/authorize?response_type=code&client_id=3a0621c0-2848-47f5-83ee-bebeede8aaa6&resource=

I can add my credentials here and then i get redirected to my welcome page and there is a very long code in my uri and after that a short session code. What does this mean? Am i logged in now? How can i test that and how can i create different roles for my Application now?

Could it be that i have to enable the default laravel Authentication with the "php artisan make:auth" command? Is it bad that i have no resource in the uri u see above? What do i have to put there?

lxg95
  • 553
  • 2
  • 8
  • 28
  • to see if your logged in you can add in your blade this `@if(auth()->check())

    Hello World

    @endif` to create different roles in the application you need to start using the middleware of laravel [tutorial laravel middleware](http://connorleech.info/blog/Build-a-quick-admin-panel-in-Laravel-5/) it shows you how to make an admin role what you can also make more roles like that like mod etc
    – HashtagForgotName Jun 17 '19 at 15:07

1 Answers1

0

First, understand OAuth on Azure. https://learn.microsoft.com/en-us/azure/active-directory/develop/v1-protocols-oauth-code

You do not need a resource if you are using the "converged" endpoint (v2). The endpoint you show is v1, so yes, you need to specify what resource you're authenticating against and what granted permissions are for it. Check out What is the Resource parameter in Windows Azure AD tenant application oAuth 2.0 specification

Have you created an app registration (see the Azure Active Directory blade)?

Welcome to OAuth.

Micromuncher
  • 903
  • 7
  • 19
  • Thanks for the first Link. I already found that and was wondering if i need to understand that. Now i will go through it. What do you mean with Azure Active Directory Blade? Is that the B2C Blade? I don't have permission to do something with the B2C stuff because my Company doesn't want me to do something with that. Or do you mean something else? – lxg95 Jun 17 '19 at 18:51
  • the vertical tabs - called blades – Micromuncher Jun 17 '19 at 20:58
  • ah yeah, there is an app registration for my page – lxg95 Jun 18 '19 at 07:38