Spring Security Fundamentals - Lesson 4 - Multiple authentication providers

Sdílet
Vložit
  • čas přidán 11. 08. 2022
  • In this stream, we discuss Spring Security using the latest available version in 2022. We'll discuss configurations for authentication and authorization, tips and tricks, how to learn Spring Security, vulnerabilities, OAuth 2, and many more.
    Code on GitHub: github.com/lspil/youtubechann...
  • Věda a technologie

Komentáře • 98

  • @emersontavera9362
    @emersontavera9362 Před rokem +5

    Your drawing are the best, lesson 4 so far, expecting to learn a lot by the end of the series, thanks for your great effot to bring this content to all of us who are getting started in web development

  • @xxmehmetali1
    @xxmehmetali1 Před rokem +4

    As you said, it is realy helpful for us to understand what is going on on the code when you draw a schema. Thanks.

  • @anjaliwarrier1610
    @anjaliwarrier1610 Před 4 měsíci

    The best Spring Security tutorial for beginners. thank you so much

  • @ashishsengar87
    @ashishsengar87 Před rokem +1

    Thanks a lot for the video. It helped me to move to a new way of configuring spring security. I was stuck on how to provide an authentication manager in a new way.

  • @168buddha
    @168buddha Před rokem +1

    Thanks you so much Laur Spilca, This playlist is amazing for Spring Security. 🥰

  • @jbparkthree
    @jbparkthree Před 10 měsíci +1

    I really appreciate this tutorial video. Many thanks 🙂

  • @laurspilca
    @laurspilca  Před rokem +1

    Code on GitHub: github.com/lspil/youtubechannel/tree/master/ss_2022_c4_e1

  • @arunkumarka1809
    @arunkumarka1809 Před 8 měsíci

    You are rocking brother. Thanks for the tutorials.

  • @mihai.vlasceanu
    @mihai.vlasceanu Před rokem +1

    Hi
    Great work. Thanks for this playlist.

  • @mustafakucuk1338
    @mustafakucuk1338 Před 3 měsíci

    Thank you for preparing these great videos

  • @nimacode
    @nimacode Před rokem +1

    thanks for your effort im looking forward to new episodes 😍😍

  • @farjallahhaythem5675
    @farjallahhaythem5675 Před rokem

    thank you for your work it's soo great and helpfull hope u continue the playlist it perfct time i want to have deep knowledge abt spring i make some basics application and ur lecture i learnt from uu soo muchh thankk again keep it up plzz

  • @for_whom_the_bell_tolls
    @for_whom_the_bell_tolls Před měsícem

    Well first of all it is just a fabulous playlist and this tutorial in particular, thank you so much. I've tried to implement exactly what's shown here: kinda api-key (custom) + oauth2-resource-server (default) authentications, and both reading official documentation and debugging the framework didn't really help. Spring Security Docs describes all the components involved quite abstractly, but it's not enough at all to understand how to implement this kind of stuff.
    Although I would implement this chain filter-authManager-authProvider in a more 'Springy' way, which is making them all beans (probably using @Component) and inject to each other and injecting the key into the ApiKeyProvider via @Value directly. From the general perspective it seems a bit cleaner then creating new Manager and Provider with every request and pass the Key through the chain of constructors. But in this case Spring Security somehow registers our ApiKeyProvider (as it becomes a Bean) as a provider for the parent of ProviderManager used by BearerTokenAuthenticationFilter😵‍💫 Crazy things, looks like it doesn't break anything, just ignored due to token type mismatch, but still a bit annoying.
    Is this a viable approach or these beans will backfire at some point?

  • @distanceprogramming
    @distanceprogramming Před 11 měsíci

    Thanks for your great effot.

  • @santiagozapata9056
    @santiagozapata9056 Před rokem +3

    Great work as always, would be cool if you mention ProviderMaanager and AbstractAuthenticationProcessingFilter, that last one is pretty nice as it's the "opposite" of OncePerRequestFilter

    • @laurspilca
      @laurspilca  Před rokem

      Thanks, Santiago.

    • @miscvideos47
      @miscvideos47 Před rokem

      Yeah, extending AbstractAuthenticationProcessingFilter helps you avoid a lot of the boilerplate code!

  • @jolskey
    @jolskey Před rokem

    Hello Laurentiu, can you tell me why don't you return from the function after line 29 on 59:04? Even if the chain continues to the next filter, won't the doFilterInternal function still be executed till the end? Thanks.

    • @laurspilca
      @laurspilca  Před rokem +1

      Hi Sandro. Excellent spot! Yes. I think I should have returned there. My mistake :) But hopefully, you got the whole idea of the example.

  • @michaelj7677
    @michaelj7677 Před rokem +3

    Hey, I was just reading the source code of GlobalMethodSecurityConfiguration and found a way to access the default AuthenticationManager without extending the WebSecurityConfigurerAdapter.
    You can inject the AuthenticationConfiguration bean and then call the .getAuthenticationManager() method. Didn't test in in a custom filter yet, but in a controller, it works. It retrieves me the default instance of the ProviderManager.

    • @laurspilca
      @laurspilca  Před rokem

      Hey. Thanks for sharing. I will test it.

    • @khajalieubarrie5088
      @khajalieubarrie5088 Před rokem

      Hey Michael and for anyone looking to get hold of the default authentication manager..I was able to get access to the default AuthenticationManager by using AuthenticationManagerBuilder object in my CustomFilter class and one of it's instance method called getObject() which returns the current Authentication Manager in the context. Thanks.

  • @piyushlovanshi8142
    @piyushlovanshi8142 Před 2 měsíci

    thank you.

  • @intBRiNGER
    @intBRiNGER Před rokem +1

    Hey Laurentiu.
    First of all, many thanks for updating the playlist regarding Spring Security. It's very useful.
    I wonder if it is possible to have multiple Custom Authentication Providers for the single Custom Authentication Manager?
    If is it correct I would like to clarify one point according to their proper responsibilities of them.
    Is it true for proper authentication enough only one successful executing authenticate method into one of the custom providers or authentication should be passed through the multiple custom providers' chain?

    • @laurspilca
      @laurspilca  Před rokem

      Hello. Yes. It is possible to have multiple custom authentication providers for a single custom authentication manager. I'm not sure if I understood the second question. So, it is enough one of the providers to give a go, but at the same time if one of them throws AuthenticationException it's a no go. So if an authentication provider cannot decide, either its supports() method should return false or the authenticate() method should return null.

  • @TheodoreRavindranath
    @TheodoreRavindranath Před 4 měsíci

    28:00 Maybe filter is called again if request is forwarded? That would mean that if I authenticate, perform an action and forward to a JSP, then there will be no need to authenticate again with the JSP page URL. That's my guess!

  • @sagarchandtripathy5115

    Hi,
    Is it not good to directly access the key from the property file in the authentication provider and put the key from the header in the filter while passing the same to the authentication manager? Why did you carry the secret key from the property file all along from the filter till the authentication provider?
    While I tried to get it directly from the property file in the auth-provider, Spring does not generate the password for me while the key authentication works fine.
    Kindly help.

  • @h.5544
    @h.5544 Před rokem +2

    Hi, thanks again for the video!
    I have two questions:
    - Does multiple authentication mean that the user can either authenticate (in this case) with http basic OR apikey?
    -Last week in order to add a filter you replaced it with UsernamePasswordAuthenticationFilter and this time you added one before BasicAuthenticationFilter. How can I always know where/when to add them?

    • @laurspilca
      @laurspilca  Před rokem

      Hi. Thanks for the questions. Let me try answering them here:
      1. Yes, that's perfectly right. The client will be able to use either of the authentication methods.
      2. UsernamePasswordAuthenticationFilter is used by the formLogin() method and it's in the same place like BasicAuthenticationFilter (which is for HTTP Basic). So, technically speaking it works the same if you use one or the other.

  • @anujpratapsingh8676
    @anujpratapsingh8676 Před rokem

    Hi @Laur,
    First of all thanks for such a great content.
    I've doubt:
    I'm trying to follow this video with a little change by putting the custom Authentication manager and provider in the context using the @Component annotation. As soon I do so the http-basic auth doesn't seem to work.
    Can you please explain it?

    • @laurspilca
      @laurspilca  Před rokem

      Hi Anuj. Thanks for the question. I'm not sure I can provide an answer seeing nothing on what you did. Most likely you missed or misconfigured something.

  • @mahmoudhesham140
    @mahmoudhesham140 Před rokem +1

    Thank you so much for this amazing Playlist.
    I have a question, in the previous lesson you used addfilterat to replace the pre-configured filter which was UsernamePasswordFilter with your Customfilter in this lesson you used addFillterBefore and you add you filter before the default filter why did you use BasicAuthenticationFilter instead of UsernamePasswordFilter

    • @laurspilca
      @laurspilca  Před rokem +2

      Hi Mahmoud. Good question. One filter managers the form login,the other the basic auth. In main, it's the same what I did since they are at the same position in the filter chain.

    • @mahmoudhesham140
      @mahmoudhesham140 Před rokem

      @@laurspilca got it thank you for answering, waiting for the next lesson 👌

  • @habt_a
    @habt_a Před 5 měsíci

    Amazing Lesson! thank you very much for your generosity. I have got one problem it tried to use both httpBasic and the request header at the same time, by using Basic Auth and by setting request header and it throws NullPointerException in the BasicAuthenticationFilter as httpBasic Auth uses the getName() method of ApiKeyAuthentication. the problem only occurs when i use the correct header value. FYI i used spring boot 3.2. Many thanks again.

    • @laurspilca
      @laurspilca  Před 5 měsíci

      Hello. I would need to debug that to see what the problem could be. I'm not sure I could figure out by heart where the problem comes from.

  • @momedalhouma14
    @momedalhouma14 Před rokem +1

    Hello, thank you for the lesson, hope you explain in the next live the following question:
    What you have shown is that on every request we are going throught the filters, but in reality the user authenticate only once, afterwars he might send a coockie or sessionId, could you please show how it is handled in the backend? should we create a new filter to check for the session or the coockie? or it is handled by spring security already? can you show an examlple on that?

    • @laurspilca
      @laurspilca  Před rokem +1

      Hi. Thanks for the question. I will explain it in the next session. Please remind me if I forget until next week :)

  • @for_whom_the_bell_tolls
    @for_whom_the_bell_tolls Před měsícem

    Ahhh and it seems there is a small bug: in ApiKeyFilter if requestKey == null we just call doFilter, but then when execution comes back to this method (since it's a chain of responsibility) it starts executing the whole ApiKeyAuthentication code block, which should probably be wrapped by else { }

  • @vutranang8053
    @vutranang8053 Před rokem +1

    As you said, we can have multiple AuthenticationProvider classes. However, when I declared 'CustomAuthenticationProvider' implements 'AuthenticationProvider', the generated security password from Spring Security disappeared. Could you explain this ? Thank you very much.

    • @laurspilca
      @laurspilca  Před rokem +1

      Hello. The default configuration is made to be overridden. Once the developer creates their custom implementation the default one doesn't exist anymore. If you wish to use both, its your (the developer) duty to configure them both. Hope this helps.

  • @md.jahidhasan5412
    @md.jahidhasan5412 Před rokem +1

    You could get the key from the application.properties file directly in the CustomAuthenticationProvider. Is there any specific reason why you propagated the key through filter, manager and finally to provider?

    • @laurspilca
      @laurspilca  Před rokem

      Hi. No. No specific reason. It's just an example.

  • @jaco0646
    @jaco0646 Před rokem +1

    When you add a custom security Filter, how do you know where to place it in the SecurityFilterChain?
    In this lesson we use: `addFilterBefore(new ApiKeyFilter(key), BasicAuthenticationFilter.class)`
    But the previous lesson used: `addFilterAt(customAuthenticationFilter, UsernamePasswordAuthenticationFilter.class)`
    Where can we learn about these existing Filters and how to place our own Filters in relation to them?

    • @laurspilca
      @laurspilca  Před rokem

      Hi. Thanks for the question. I think the answer it "it depends". Usually you know depending on what your custom filter does if it should be for example before or after authentication, or before or after CORS, or before or after CSRF. It mostly depends on what logic you want to be executed before and after it.

  • @FedericoFavaro
    @FedericoFavaro Před rokem +1

    Hi Laurentiu, I was wondering about this approach of having the AuthenticationManager be a manually managed object rather than a bean, doesn't it impact performance negatively?
    By this I mean, correct me if I'm wrong, by having the managers and providers as @Beans, they are instantiated once at application startup and they keep being reused at every request. If the new approach implies the custom manager not being a bean (because otherwise it overrides the default one), this means that a new manager is instantiated at every request, which, in a stateless session application, would be a big performance hit I believe.
    What is your take on this issue?

    • @laurspilca
      @laurspilca  Před rokem +1

      Hi Federico, This is a good point. But I'd not be concerned about it. In the end, is only an object instance, isn't it? At the same time, you could say the same thing about any HTTP request and response parameter. I doubt that instance would make a big impact.

    • @FedericoFavaro
      @FedericoFavaro Před rokem +1

      @@laurspilca Thank you for your answer, this makes sense, you're right, it wouldn't be as impactful as I was thinking!

    • @michaelj7677
      @michaelj7677 Před rokem +1

      You don't need to create an instance per request. You can just initialize the CustomAuthenticationManager as a field once. Or, because OncePerRequestFilter extends GenericFilterBean, you can just inject your authentication manager bean.

    • @laurspilca
      @laurspilca  Před rokem +2

      @@michaelj7677 Hi Michel. I'm not sure you have an option to inject the authentication manager bean with the last Spring Security versions. If you define an authentication manager as a bean, you'll override the existing one. If that's what you need, that's ok, but if you don't want that, then you won't be able to inject it either. So it really depends on what you want to do.

  • @bhaveshshah3405
    @bhaveshshah3405 Před rokem +1

    Hi, great work. Learning alot from your tutorials.
    1 doubt I had was, shouldn't we have custom authentication logic inside `else` block like below. As I see without else block, even if we are passing basic auth, the custom filter gets executed or am I missing anything ?
    ```java
    if (authKey == null || "null".equalsIgnoreCase(authKey)) {
    filterChain.doFilter(request, response);
    } else {
    CustomAuthentication customAuthentication = new CustomAuthentication(authKey);
    CustomAuthenticationManger customAuthenticationManger = new CustomAuthenticationManger(key);
    final var authentication = customAuthenticationManger.authenticate(customAuthentication);
    if (authentication.isAuthenticated()) {
    SecurityContextHolder.getContext().setAuthentication(authentication);
    filterChain.doFilter(request, response);
    }
    }
    ```

    • @abhilashbhyrava277
      @abhilashbhyrava277 Před 9 měsíci

      you can return in the if block, that is what spring does in its filter implementations too

  • @Kamil92Zgon
    @Kamil92Zgon Před 3 měsíci

    There was a lot of changes in spring security in a last few years!

  • @prashobmp
    @prashobmp Před rokem +1

    Thank you for this great content. I was trying to do the same in spring boot 3.0 and I was getting exception in BasicAuthenticationFilter.java "Cannot invoke "String.equals(Object)" because the return value of "org.springframework.security.core.Authentication.getName()" is null". For some reason BasicAuthenticationFilter is using the same CustomAuthentication object (created for API key authentication, it is looking for username inside cusomAuthentication object and gets NP exception) . Then in my webconfigsecurityConfig.java file i changed the filter configuration to addFilterAfter basicAuthenticationFilter and it started working. Is it because of spring boot versions or am I doing something wrong.

  • @ppvan
    @ppvan Před rokem

    Hi, awesome video as always
    There is a point that i don't get it. On 1:00:36 , line 38.After authenticating by key, the filter chain is delegated to httpBasic filter, but why the httpBasic does not ask the user and password again? (as in the case of line 29 where the same .doFilter apply)

    • @laurspilca
      @laurspilca  Před rokem

      Hi, Since I configured my own filter and didn't add the HTTP Basic configuration, there's not HTTP Basic filter at all to ask for those credentials.

  • @alxdm9760
    @alxdm9760 Před rokem

    Hi, in case I just want to add a custom provider, should I go through the process of making a custom filter, custom manager, then the new provider? “Coz in the good old spring security oauth2 library, this is possible….my use case is I want to get a bearer token, process it to get the “sub” data and convert it to a UserDetail object, then make it as a principal of the custom authrntication….I want the authenticated principal to be a UserDetail object and not an object carrying token data

    • @laurspilca
      @laurspilca  Před rokem +1

      Hi. Yes. You can alwasys configure the authoization manager with any custom provider you want. That's actually what I also do in this lesson.

  • @RajeevanKuganathan
    @RajeevanKuganathan Před rokem +1

    59:03 After the null check don't you need to put the remaining code in the else case?

    • @laurspilca
      @laurspilca  Před rokem +1

      Yes. I think I should have. However, to be honest with you it's so long since I made this video that I don't remember which were my intentions at that time :)

  • @shreejanacharya8284
    @shreejanacharya8284 Před rokem

    Hello Laur, thanks for this tutorial. My confusion is when we put ApiKeyFilter before BasicFilter and when we authenticate by using ApiKeyFilter does it skip BasicFilter? Or there is a mechanism in BasicAuthenticationFilter to skip when user is already authenticated?

    • @laurspilca
      @laurspilca  Před rokem

      Hi. THe ApiKeyFilter is put before the position of BasicFilter. But since we don't configure a basic filter at the SecurityFilterChain level, that filter is not in the chain.

    • @mohammedwk6901
      @mohammedwk6901 Před rokem

      Hi Laur, first thank you,
      But I don't get this, if we didn't have BasicFilter how the authentication worked when we send username and the generated password.

    • @laurspilca
      @laurspilca  Před rokem +3

      @@mohammedwk6901 Ok. So I checked again the example. I was confusing it with another one (sorry, I have many and do not always have time to check). So I see here that I have two different authentication providers. You can use either. Spring Security knows to find the appropriate one. When one succeeds, the SecurityContext is filled with the authentication so the other doesn't check anymore. I hope it makes sense. You can also do some debugging on the framework's code to understand deeper what happens there.

    • @mohammedwk6901
      @mohammedwk6901 Před rokem +1

      @@laurspilca got it
      And
      Thank you so much for this great content

    • @shreejanacharya8284
      @shreejanacharya8284 Před rokem +1

      @@laurspilca Thank you. It is clear now.

  • @mahmoudhesham140
    @mahmoudhesham140 Před rokem +2

    When I tried to annotate my CustomeManager and CustomeProveides with @component to inject it into the filter bean like in the previous video but the auto-generated password did not appear. can you please explain why?!

    • @laurspilca
      @laurspilca  Před rokem +1

      Most likely the way you wrote the code made Spring Boot to exclude the auto configuration of the UserDetailsService.

    • @i_m_gdv
      @i_m_gdv Před rokem

      UserDetailsServiceAutoConfugration class has a @conditionalOnMissingBean annotation which has AuthenticationProvider as it's value. I think this is the reason why auto generated password not occurs.

  • @bastianwilhelm2394
    @bastianwilhelm2394 Před rokem +1

    Hello Laurentiu,
    and first of all: Thanks for the great tutorials.
    For the AuthenticationManager I found a solution to use only one (the default) AuthenticationManager of Spring Security:
    I need to build a Configurer for that:
    @AllArgsConstructor
    public class ApiKeyHttpConfigurer extends AbstractHttpConfigurer {
    private final String key;
    @Override
    public void configure(HttpSecurity http) throws Exception {
    final AuthenticationManager authenticationManager = http.getSharedObject(AuthenticationManager.class);
    http.addFilterBefore(new ApiKeyFilter(authenticationManager), BasicAuthenticationFilter.class);
    http.authenticationProvider(new ApiKeyProvider(key));
    }
    }
    This configurer can then be used in the SecurityFilterChain as follow:
    @Bean
    public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
    return http.httpBasic()
    .and().apply(new ApiKeyHttpConfigurer(key))
    .and().authorizeRequests().anyRequest().authenticated()
    .and().build();
    }
    I hope it helps to reduce unnecessary code for a second AuthenticationManager.
    Used source: stackoverflow.com/a/71449312

    • @laurspilca
      @laurspilca  Před rokem +1

      Hey. Thanks. Someone told me that using getSharedObject() this way is not recommended. because things can change internally in how the framework works. But I will double check.

  • @ridasafwan1240
    @ridasafwan1240 Před 8 měsíci +1

    Halo Laurenti, In lesson 3 you created the Filter 'CustomAuthenticationFilter' as a component and then you inject it in the SecurityConfig class, while in this lesson you created Similar filter 'APIKeyFilter' which serves same role as lesson 3 but here you configured a new instance of it in the SecurityConfig class. why is this difference?

    • @laurspilca
      @laurspilca  Před 7 měsíci +1

      Hello. Thanks for the question. The only difference between the two would be that the one in lesson 3 is in the Spring context. This way I would be able to use specific Spring features with that instance (in other words, that instance is a bean in the Spring context and Spring knows how to manage it). In lesson 4 I create an instance using the new operator. Since I don't add it to the Spring context I wouldn't be able to use any capability such as transactionability, logging or dependency injection with it. From a Spring Security point of view, it makes not difference if the instance is or not a bean. But depending on how you'd want to use if further you need to decide if it makes sense for your case to be a bean.

    • @ridasafwan1240
      @ridasafwan1240 Před 7 měsíci

      Thank you very much for clarification @@laurspilca

  • @abhilashbhyrava277
    @abhilashbhyrava277 Před 9 měsíci +1

    are filters, managers and providers beans in the spring context?

    • @laurspilca
      @laurspilca  Před 9 měsíci

      Hi. Not necessarily. It's your choice if you want to make them beans. Of course, you'd choose that according to general Spring rules - in case it helps you that object to be in the context, then you make it a bean.

    • @abhilashbhyrava277
      @abhilashbhyrava277 Před 9 měsíci

      @@laurspilca I actually tried using a custom filter and a default filter, like in your tutorial and made the custom filter, manager and provider as beans. But it was not working.
      The custom manager was able to pick up the custom provider, but the ProviderManager was not able to pick up the default provider (i was using a mysql database to store users).
      But once i removed the custom provider from the context and instantiated it, the default provider was working.
      Can you explain this behavior?

  • @naebara1297
    @naebara1297 Před rokem

    Hello.
    First of all, your teaching skills, awesome. Im grateful i found your channel, actually not too long ago:))
    I followed the video step by step, but the api authentication by using api key does not work. Only basic auth works.
    I also copied your code as is and the result is the same.
    I made sure i removed any cookies from Postman but there is nothing else i can think of.
    Any suggestions?

    • @laurspilca
      @laurspilca  Před rokem

      Hi Nae. I recommend you watch the new playlist Spring Security Fundamentals 2022. It's difficult for me to know what exactly you do wrong, but could it be that you try to use new versions with old ways to configure them?

    • @naebara1297
      @naebara1297 Před rokem

      @@laurspilca Hello
      I'm watching the 2022 playlist:))
      I made sure I use same spring boot version, copied your code from repo but still does not work. Maybe something related to postman?

    • @zabhishekraj3567
      @zabhishekraj3567 Před 3 měsíci

      ​@@naebara1297 same problem.

    • @zabhishekraj3567
      @zabhishekraj3567 Před 3 měsíci

      ​@@naebara1297 but after debugging i found error in my code i.e @Value("${the.secret}"), I was forget to use $ sign, Now its working. I think you should check your code again.

  • @mayankgupta2543
    @mayankgupta2543 Před 5 měsíci

    I am getting an error something like
    IllegalArgurment there are 4 beans for AuthenticationManager found but none is primary.
    Dors anyone has any clue, how to fix it. I want to know when does this happen? And how to fix it.

    • @laurspilca
      @laurspilca  Před 5 měsíci

      Hey. I don't think I can be of any help with this few information. Can you be more explicit please?

    • @mayankgupta2543
      @mayankgupta2543 Před 5 měsíci

      @@laurspilca hi could you please share your mail id? I will share my configurations and the error
      Thanks

    • @mayankgupta2543
      @mayankgupta2543 Před 5 měsíci

      @@laurspilcai am getting error because I have multiple authentication managers like for kerbos, saml etc configured in different xml as per profile.
      But i have configured filters for OAUTH in a java configuration and I think when it runs through it, it finds those authentication managers present in different xmls. And gives the above error that none is marked as primary.
      So is there any way I can explicitly tell which authentication manager to use . I will create one bean for oauth in the same java configuration file. But I don’t know ow how do i tell spring to use that only when looking for authentication managers.
      May be in my filters if i could write any code which could say use this particular authentication manager specifically

  • @Sebastian-zs8cp
    @Sebastian-zs8cp Před 18 dny

    It's terribly complicated and confusing what options I have. You have to learn it by heart and IntelliJ doesn't really help

  • @jahongiratametov9985
    @jahongiratametov9985 Před rokem +1

    Custom and ugly authentication🤣

  • @ahmadbuba1347
    @ahmadbuba1347 Před 11 měsíci

    httpBasic() is deprecated and marked for removal, how do i go about it?, lesson 4

  • @lunatichigh2896
    @lunatichigh2896 Před rokem +1

    Thank you for the videos sir, I need help.
    I was making my own implementation loosely based on your code. I'm always having this error message whenever I send a request :
    No primary or single unique constructor found for interface org.springframework.security.core.context.SecurityContext
    What could be posibly causing this problem?T hank you

    • @laurspilca
      @laurspilca  Před rokem +1

      Hey. I'm not sure. It depends on what you are doing. Maybe you are trying to make the security context a bean? If that's the case, it won't work since the class has more than one constructors.