Advanced JAX-RS 24 - Implementing REST API Authorization

Sdílet
Vložit
  • čas přidán 25. 01. 2016
  • Access the full course here: javabrains.io/courses/javaee_...
    Let's implement Basic Auth by using a Security Request Filter and have clients login using a user ID and password.

Komentáře • 47

  • @AshishRajput-fh4bh
    @AshishRajput-fh4bh Před 3 lety

    Not even single place out there, save this where you can find these concepts with such intricacies. Thank You so much. You are a savior.

  • @Alexyslozada
    @Alexyslozada Před 8 lety +15

    I don´t speak English, but i understand almost all. Excellent videos!!!

  • @RajaAnbazhagan
    @RajaAnbazhagan Před 8 lety +13

    Really great tutorials.... Looking forward to a separate OAuth and OAuth2 Session... :)

  • @gorantisridhar
    @gorantisridhar Před 6 lety

    Thank you for sharing. Really great tutorials.

  • @greagarious44
    @greagarious44 Před 6 lety +2

    Thanks. Need a series on implementing oauth 2.0 authorization with jersey. That would be awesome

  • @LaMochAna
    @LaMochAna Před 7 lety +2

    Amazing tutorial !!
    It 'll be nice to have one on how to build a client application that consumes REST API with Oauth

  • @shashib8036
    @shashib8036 Před 6 lety +2

    Hi,
    This is great video about basic auth mechanism for rest api,
    I am looking for oAuth with Rest API not only me, more people are looking for oAuth mechanism. thanks.

  • @anilkinikar
    @anilkinikar Před 6 lety

    Excellent Tutorials

  • @simawdf
    @simawdf Před 4 lety

    Thanks a ton sir! real gem.

  • @anasheko2432
    @anasheko2432 Před 6 lety

    very helpful, thanks alot..

  • @restablex
    @restablex Před 8 lety +2

    Great tutorial... It would be great to have an OAuth 2.0 example... thanks

  • @yeskumar78
    @yeskumar78 Před 3 lety

    Awesome tutorial.. thanks..

  • @barneyvinicius
    @barneyvinicius Před 6 lety

    Very nice man .... excellent

  • @kishorevanapalli
    @kishorevanapalli Před 8 lety +6

    Hi, This is a great resource. I am looking for details on Jax RS with OAuth. Can you point me to a direction?

  • @gauravdighe4117
    @gauravdighe4117 Před 8 lety +6

    Hey can you demonstrate Spring-REST, Spring-Hateoas with Spring-OAuth2

  • @mehdielamri5400
    @mehdielamri5400 Před 6 lety

    Hey, thank you for this tutorial it was great !!
    how can i get the current user using this approch thank you ?

  • @shivarajbiradar8977
    @shivarajbiradar8977 Před 4 lety +1

    it is not authorizing when i try in postman, i am getting api output directly did i missed any thing?

  • @shakirali6390
    @shakirali6390 Před 5 lety

    Hi Sir, What will happen if more then one filter class are available in same application, as you said every request will go through the filter class first? kindly reply

  • @pnkjshrm307
    @pnkjshrm307 Před 6 lety

    Hi,
    It is perfectly working and tested with Postman, but in real time application how to send such request(Html/Angular4), can you please describe.

  • @varunmaraka3171
    @varunmaraka3171 Před 6 lety +4

    Sometime decoded value does not appear properly because there is extra space after replacing first string of Authentication header (Basic dXNlcjpwYXNzd29yZA==).
    -----------------------------------------
    Using a Trim function after replace.
    authTok=authTok.replaceFirst(AUTHORIZATION_HEAD_PREF, "");
    authTok = authTok.trim();

  • @satyanveshvanapalli9905

    hi i have a question here why we are using http we need to use https right if so will this example works

  • @tushartari6769
    @tushartari6769 Před 2 lety

    I would appreciate if you provide an example for Oauth2 Client using Jersey which includes all grant types.

  • @anjubhadouria9875
    @anjubhadouria9875 Před 5 lety

    What will happen when user name or pe already have : then how do you split

  • @ravi292008
    @ravi292008 Před 7 lety +1

    Hi Koushik,
    I was following this tutorial and came across one small thing. You forgot to mention that SecurityFilter should be annotated with 'Provider'. The request will not be intercepted by our SecurityFilter without 'Provider' annotation.

  • @Sumitanad
    @Sumitanad Před 7 lety

    can anyone please help me, what maven dependencies required for this plz

  • @shurazeta
    @shurazeta Před 5 lety

    why do you put "basic " in the value of header, and not only the value?

  • @gudvibes455
    @gudvibes455 Před 7 lety +2

    For some reason I am not getting the decoded value if I use this import org.glassfish.jersey.internal.util.Base64, the decoded value appears like this ������������, I tried multiple times... So I used apache commons codec jar instead here's the dependencies that needs to be added to add to pom.xml
    commons-codec
    commons-codec
    1.9
    and I modified the code something like this
    String authToken = authHeader.get(0);
    authToken = authToken.replaceFirst(AUTHORIZATION_HEADER_PREFIX, "");
    byte[] decodeBase64 = Base64.decodeBase64(authToken);
    String decodedToken = new String(decodeBase64, "UTF-8");
    StringTokenizer tokenier = new StringTokenizer(decodedToken, ":");
    String userName = tokenier.nextToken();
    String password = tokenier.nextToken();
    and it worked.

    • @slsriram
      @slsriram Před 7 lety

      Got the same error. This works!!

    • @varunmaraka3171
      @varunmaraka3171 Před 6 lety

      Decoded value does not appear because there is extra space after replacing first string of Authentication header (Basic dXNlcjpwYXNzd29yZA==).
      -----------------------------------------
      Using a Trim function after replace works.
      authTok=authTok.replaceFirst(AUTHORIZATION_HEAD_PREF, "");
      authTok = authTok.trim();

  • @buddhikasandaruwan4355

    what are the dependencies that are need to added?

  • @azizuddin9269
    @azizuddin9269 Před 5 lety

    your videos are fabulous .. but you missing to provide details on web.xml , how it needs to be configured ..

  • @deffy18
    @deffy18 Před 4 lety

    Thanks for a great course! but you know, you described authentication here, not authorization ;)

  • @ManojKumar-ut6ck
    @ManojKumar-ut6ck Před 4 lety +2

    Some how its not working for me... is there any thing need to add web.xml or pom.xml. My api is working but not asking for authentication.. Please help .. thanks in advance

  • @ShubhamTakode
    @ShubhamTakode Před 7 lety +3

    what if someone entered ' : ' in user-name or password ?

    • @najmlion7129
      @najmlion7129 Před 4 lety

      the username and password has to match to continue so I image you would still get an error.

  • @abhijeetzade3336
    @abhijeetzade3336 Před 5 lety

    No such element exception at string tokenizer

    • @niharikaverma9821
      @niharikaverma9821 Před 4 lety

      Try this- tokenizer.hasMoreTokens()? tokenizer.nextToken() : null;

  • @shivarajbiradar756
    @shivarajbiradar756 Před 6 lety

    Good tutorial but explain slowly and loudly

  • @GOPIKRISHNA-tv5ct
    @GOPIKRISHNA-tv5ct Před rokem

    Getting this error.
    Root cause of ServletException.
    java.lang.AbstractMethodError: javax.ws.rs.core.UriBuilder.uri(Ljava/lang/String;)Ljavax/ws/rs/core/UriBuilder;