Reviewing ASP.NET Core Authentication Setup

Поделиться
HTML-код
  • Опубликовано: 30 ноя 2024

Комментарии • 21

  • @gordonfreimann
    @gordonfreimann Год назад +2

    in my company we implemented back end for front end because we integrated our project to an external project so bff became a client actually. the real backend has its own auth and our side has its own auth so we register our users to the other api and store their tokens in our side. when they are authorized in our side we match their token and just proxy it to the api that we integrated our app and get the response & modify it for our front end and return it

    • @RawCoding
      @RawCoding  Год назад +1

      the only time ROPC will slide is if you own all components.
      www.scottbrady91.com/oauth/why-the-resource-owner-password-credentials-grant-type-is-not-authentication-nor-suitable-for-modern-applications

  • @agentvettel8720
    @agentvettel8720 Год назад +3

    Thank you very much for your videos, Anton!

    • @RawCoding
      @RawCoding  Год назад +1

      thank you for watching!

  • @kiranayyanki6691
    @kiranayyanki6691 Год назад +2

    Good Video, does 'Miro' pay you for the display? They should if they don't :)

    • @RawCoding
      @RawCoding  Год назад +1

      they don't and damn right they should! Like comment on this: twitter.com/anton_t0shik/status/1617927460989067265

  • @nove1398
    @nove1398 Год назад

    This needs a talk on BFF implementation spec

  • @Fenrings
    @Fenrings Год назад +2

    idea that one backend for frontend (bff) should depend on another at 8:50 defeats the whole purpose of bff pattern? In my understanding, in such case it would be better to have separate identity provider that every bff can use, as in original sample. Sorry if I misunderstood your point of view, in fact this video is hard to follow ;)

    • @RawCoding
      @RawCoding  Год назад +2

      > idea that one backend for frontend (bff) should depend on another at 8:50 defeats the whole purpose of bff pattern?
      1. BFF can be used in 2 ways that I know
      1.1 firstly aggregate access to backend components (which can be on a private network), so your frontend is talking to a single backend rather than multiple (nothing to do with auth).
      1.2 extending 1.1 - you are proxying all your requests but also holding authentication obtained from other components (in this situation the backend infrastructure may not belong to you)
      2. Having a 2nd app to access the API is okey (look at github and multiple UI client libraries, it's multiple views/controllers in to the same data) the 2nd app will need to get and store the tokens hence it'll have it's own Backend. Further more - how many components do you want to configure? before we'd have to configure the external bff with all the api's and external oidc servers, after turning the local BFF in to an authentication server you'd only need to configure it in 1 place.
      > in such case it would be better to have separate identity provider that every bff can use, as in original sample.
      1. saying the original sample was an identity provider is a bit of a stretch, mainly for being able to produce multiple login screens & not wrapping external authentication sessions, the BFF is orchestrating all of it.
      2. "better" is questionable (try to articulate some actual reasons) multiple infrastructure components comes at a cost - it's okey to have a BFF play both roles of Client and Auth Server, or the Backend can be the API and Auth Server. In fact a single component playing all 3 roles is the default - you need to give good reasons to split them out.
      > Sorry if I misunderstood your point of view, in fact this video is hard to follow ;)
      that's why I answer comments hopefully it makes sense, thank you for asking the question.

  • @w4.k
    @w4.k Год назад +1

    I now feel imposter syndrome. lol

  • @Jeymikuz
    @Jeymikuz Год назад +1

    Hi, do you think that keeping jwt in cookie is a good idea or there is better and safer approach?

    • @RawCoding
      @RawCoding  Год назад +4

      it's not bad, you are exchanging convenience for functionality. if you store them in a cookie, the cookie get's bigger and you don't have access to them from the server which means you can't refresh them.
      if you want to know more:
      what and how of jwt - ruclips.net/video/8FvN5bhVYxY/видео.html (info about jwt)
      handling jwt in oatuh - ruclips.net/video/0uSwPdYOm9k/видео.html (how to store tokens in database)
      refreshing tokens - ruclips.net/video/EC69dEspO64/видео.html (how to refresh tokens in the background)

    • @Jeymikuz
      @Jeymikuz Год назад

      ​@@RawCoding Ok cool, thanks for the answer

  • @ahmedhegag2526
    @ahmedhegag2526 Год назад

    what is backend for frontend means
    is it another backend the frontend call before it calls the actual backend that contains the business logic
    if so why would we do two backends ?

    • @gabrieldassen
      @gabrieldassen Год назад

      He used "Backend" to refer to the domain logic. To make sense put a BFF on de design, this "backend" must be a set of distributed services, like microservices.

  • @josephizang6187
    @josephizang6187 Год назад

    Awesome

  • @adrian_franczak
    @adrian_franczak Год назад +1

    so migrating users from my app to something like auth0 is bad idea?

    • @RawCoding
      @RawCoding  Год назад +4

      It largely depends on what your business goals are, but what made you think that?
      I've talked about not duplicating user entities if you don't need to - there is identity management and authentication, if something is already managing identities externally why do you need to do it again?

    • @adrian_franczak
      @adrian_franczak Год назад

      @@RawCoding ok now that makes sense to me

  • @amineherizi4687
    @amineherizi4687 Год назад +5

    I found the video to be difficult to follow because of all the drawings that were done and later removed. :(