KEYCLOAK Client Access Types explained: public, confidential, bearer-only | Niko Köbler (@dasniko)

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ส.ค. 2024

ความคิดเห็น • 46

  • @stantonviaduc4168
    @stantonviaduc4168 3 ปีที่แล้ว +2

    Bearer-only clients were still a mystery for me before this video. Thanks!

  • @actarusgunhed4712
    @actarusgunhed4712 2 ปีที่แล้ว +2

    You rock Nikö ! Clear and very understandable, thank you ! Let Keycloak live long !

  • @javageek123
    @javageek123 3 ปีที่แล้ว +1

    Falling in love with dasniko's style of tech talks. I wish I can give multiple Thumbs up.

    • @dasniko
      @dasniko  3 ปีที่แล้ว

      😍🤩🙏

  • @grsamsta
    @grsamsta 3 ปีที่แล้ว +8

    As always, great content Niko. However, you didn't mention that for a public client you should move away from Implicit Flow towards Auth Code with PKCE and how to configure Auth Code with PKCE configured in Keycloak. Anyway kudos for creating this Keycloak series.

    • @dasniko
      @dasniko  3 ปีที่แล้ว +3

      Damn, I knew I forgot something... You are totally right, this is missing!
      Thanks anyway, I'm happy you like it. Hopefully with your comment, people will see this issue with implicit flow.

  • @narendrachary6592
    @narendrachary6592 11 หลายเดือนก่อน +2

    Hi can you please explain on latest Keylock 22 version ?

  • @ducanhtran4842
    @ducanhtran4842 3 ปีที่แล้ว +1

    Thank you for the awesome video, Niko!

  • @FrerkMeyer
    @FrerkMeyer ปีที่แล้ว +1

    Thank you! Vielen Dank!

  • @mugume
    @mugume 2 ปีที่แล้ว +1

    thanks @Niko - great tutorial

  • @Togrul280
    @Togrul280 2 ปีที่แล้ว +1

    Great video !

  • @medziedhaddar5653
    @medziedhaddar5653 ปีที่แล้ว +1

    Great

  • @basselkh5147
    @basselkh5147 3 ปีที่แล้ว

    Super, thanks

  • @ClaudioBarca
    @ClaudioBarca ปีที่แล้ว

    I have a SPA, the user has logged-in with public client, but the backend API has authorizations to read/write/delete resources.
    When use Public client (without client-secret) how can manage and use the resource authorization's ?

    • @dasniko
      @dasniko  ปีที่แล้ว

      Your public client (SPA) can't deal with authorizations. You'll have to make the request to the backend with the frontend access_token. Backend needs to be confidential client (with e.g. clientid/-secret) and send the received access_token for authorization policy evaluation to Keycloak to get the RPT back.

  • @pacolopez9577
    @pacolopez9577 ปีที่แล้ว

    In version 21 I can't see anywhere the option to configure a bearer only client...

    • @dasniko
      @dasniko  ปีที่แล้ว

      They are no more available since the new Admin-Ui, as they are not needed, actually.

  • @stuetz
    @stuetz ปีที่แล้ว

    Hi Nico,
    thank you for your excellent work.
    What happened with the client access types in the quarkus-version of Keycloak (currently 21+).

    • @dasniko
      @dasniko  ปีที่แล้ว +1

      Same same, but different. ;)
      "Confidential" is now "Authentication required on" and "public" is "Authentication required off". There's no explicit type for a "Bearer-only" client, as these clients do not necessarily be configured.

    • @manjunathcse
      @manjunathcse ปีที่แล้ว

      @@dasniko but what if I need a client for the backend service which can use already generated token by the frontend?

  • @akshaygupta7449
    @akshaygupta7449 2 ปีที่แล้ว

    Hi Niko, Thanks for the explanation. I am facing configuring public IP addresses on keycloak. would you mind telling if any specific configuration needs to be noted?

  • @CaptainMalibu
    @CaptainMalibu ปีที่แล้ว

    I could use some help I have an Angular application, a keyloak server and a backend server.
    I control the login process between the Angular application and the keycloak server with the public access type (standard flow). The Angular application now has the access token. I want to send requests to the backend. The backend is supposed to validate the token somehow, but for that it has to somehow get the access token or pub-key from the keycloak server. Can someone help me there?

    • @CaptainMalibu
      @CaptainMalibu ปีที่แล้ว

      Which Acces Type do i need for the backend server? Which flow? And is there a rest api so the backend can request the token or pub key?

    • @dasniko
      @dasniko  ปีที่แล้ว

      Frontend (angular) is public client with standard (auth code) grant and pkce enabled
      Backend is "bearer-only" and doesn't need to be configured in Keycloak. Depending on the library used there, it is self-configuring with the IdP-URL or you have to provide the public key for token verification.
      Frontend sends the access_token with every request to the backend in Authorization header as Bearer token.

  • @avimehenwal
    @avimehenwal 2 ปีที่แล้ว

    Hello, great video. I am looking for some examples where I can use Keycloak to power a frontend application login flow and also provide User and Role management capabilities, like CRUD on keycloak roles and users right from the frontend application. I am having hard time in finding help on this topic and any help would be appreciated. Super thankyou

  • @mehdiben9624
    @mehdiben9624 2 ปีที่แล้ว

    Hi, can two clients in the same realm communicate with each other on keycloak ? if yes, how ? if no, why ?

  • @giovannibertoncelli6777
    @giovannibertoncelli6777 ปีที่แล้ว

    Hello Niko, I was wondering, which OAuth 2.0 flow public clients use? I have this doubt since Authorization Code Flow should teoretically require always a client secret

    • @dasniko
      @dasniko  ปีที่แล้ว

      Authorization Code Grant is possible with public clients, but usage of PKCE is highly recommended (kind of mandatory, from a security perspective, not from the current specs, but it is mentioned in the OAuth2 best practices guide.)

  • @mohamedawadallah7208
    @mohamedawadallah7208 ปีที่แล้ว

    does keycloack 20 support client_credentials grant type ?

    • @dasniko
      @dasniko  ปีที่แล้ว

      Keycloak does support this since version 1.x as it is in the OAuth2 spec and Keycloak is OIDC and OAuth2 compliant.

  • @keigezellig
    @keigezellig 2 ปีที่แล้ว

    Very nice video, but i am still not sure what to use for my backend services. I have services that communicate with each other and services that communicate with the frontend (even services that communicate both with the frontend AND with another service)
    The frontend will handle all the login stuff . So should i use a confidential client with a service account or should i use a bearer-only client for the backend services?

    • @fortytoo4u
      @fortytoo4u 2 ปีที่แล้ว

      I am still trying to figure out the same thing. From this video, I got the impression that a backend service that has an API that others need to authorize against, can be a bearer-only. While a backend service that wants to call that API, should be confidential, and can then use the client credentials flow (service account in Keycloak) to get authorized.
      Would be great to have confirmation on that.

    • @Gringohuevon
      @Gringohuevon 2 ปีที่แล้ว +3

      @@fortytoo4u If you have a back-end service that receives access tokens as part of a request then that could be a bearer-only client, validating the token against the introspect or userinfo endpoint. If, however, you have a backend service that doesn't receive a token from an http request (e.g. this service reads a message queue and then needs to call other services via rest), this service will need to get a token..in this case the message queue reading service is a confidential client..eg reads message--calls Keycloak as confidential client--receives token--calls other rest services

  • @brucewayne2480
    @brucewayne2480 3 ปีที่แล้ว

    Thanks for the video , what about the mobile apps ? Which profile to choose without having a flow that requires an authentication using the browser (which is a bad user exprience) because confidential is not secure , a malicious user can unpack the app and get the secret

    • @samiraghayarov6898
      @samiraghayarov6898 2 ปีที่แล้ว +1

      For mobile apps it is still recommended to use auth code flow with PKCE extension with Chrome Custom Tabs (Android) , it is more secure version of Web Views as app doesn't have an access to Chrome Custom Tabs. You don't want to use browser as user leaves the app context.

    • @brucewayne2480
      @brucewayne2480 2 ปีที่แล้ว

      @@samiraghayarov6898 thank you ! What about the user experience ? do you have a real example ?

  • @viveksingh-hv2ph
    @viveksingh-hv2ph 2 ปีที่แล้ว

    I have a angular website which has keycloak login flow. I need to implement a new login flow wherein user can be authenticated with metamask or similar plugin. I manually save these users manually in keycloak with their public address as username. Any ideas how can I login such users authenticated from browsers plugins to the website?

    • @dunebuggy1292
      @dunebuggy1292 2 ปีที่แล้ว

      You would probably need to setup a confidential client, since in the case of metamask you're making various backend calls, unlike an SPA. From my understanding, the reason you would use a public client for SPA or mobile, is because the services are built-in, thus not requiring backend calls to reach protected areas.

    • @viveksingh-hv2ph
      @viveksingh-hv2ph 2 ปีที่แล้ว

      @@dunebuggy1292 I can create a new confidential client but how to auto login and create user session after user login through metamask from browser is where the problem is.

  • @mrshodz
    @mrshodz 2 ปีที่แล้ว

    great video. can you please do a video on policy and permissions please.

  • @xichen2677
    @xichen2677 5 หลายเดือนก่อน

    @Niko, at 03:25 you said "Confidential" client can exchange authorization code together with client id and client secret for an access token of user. Could you please clarify your statement, I mean isn't confidential client mean the back channel clients? In other words, the backend applications. Why backend to backend authorization need to use code flow? Shouldn't it just exchange client id & secret for an access token?

  • @mariospalazis-aslanidis1281
    @mariospalazis-aslanidis1281 ปีที่แล้ว

    Can you access the rest API from all three access types???

  • @manfredgriesser1409
    @manfredgriesser1409 2 ปีที่แล้ว

    you should provide a better example of a proper redirect url than "/*" in the public client description

  • @30harshal
    @30harshal 2 ปีที่แล้ว

    is reference/opaque/phantom token supported by keycloak? I don’t think they support based on my own research, is there a way we could make this work?

    • @dasniko
      @dasniko  2 ปีที่แล้ว +1

      Keycloak is OIDC. In OIDC spec, JWT format is mandatory.