Creating your First IdentityServer4 Solution

Поделиться
HTML-код
  • Опубликовано: 20 окт 2024
  • This tutorial will show you how to install IdentityServer with in-memory store. You will write a basic API that will be protected by IdentityServer and web client. Then call said API via the web client.
    EDIT: Here is the link to the source code: github.com/kev...

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

  • @identityserver
    @identityserver  2 года назад +1

    Looking for the tutorial to get started with Duende IdentityServer? We have a playlist of new videos that can help: bit.ly/3pRCNml

  • @thilom700
    @thilom700 3 года назад +7

    Great tutorial. This will be the reference video for my team to learn about IdentityServer. Well done...

  • @assismarcos1975
    @assismarcos1975 3 года назад +3

    One single word to define this tutorial: fantastic! Thanks for your great job; it helped me a lot in understanding the IndentityServer.

    • @identityserver
      @identityserver  2 года назад +1

      Hi Marcos, Thank you for your kind words, we are trying our best to make it as easy as possible.

  • @sebastianolaf
    @sebastianolaf 3 года назад +1

    this is the best explanation I can found on how the actual "magic" is working .Deserve a Like

    • @identityserver
      @identityserver  3 года назад

      Thank you! - Don't worry there is still lots of magic left to learn :)

  • @jan5310
    @jan5310 3 года назад +5

    Thanks for this great tutorial! One of the best on Identity server!

    • @identityserver
      @identityserver  3 года назад

      Hi Jan! Thank you so much for the kind words! We wish you a happy new year!

  • @umpgod7573
    @umpgod7573 4 месяца назад

    You showed almost all possible ways to use identity server in one 30 min video. Thanks! :D

  • @jan5310
    @jan5310 3 года назад +4

    On Windows using Curl is a bit different. Use double quotes and remove the space between -X and POST. For example the command at 09:29 is:
    curl -XPOST "localhost:5443/connect/token" -H "Content-Type: application/x-www-form-urlencoded" -H "Cache-Control: no-cache" -d "client_id=m2m.client&scope=weatherapi.read&client_secret=SuperSecretPassword&grant_type=client_credentials"
    Better use Postman... great tool!

  • @gligom
    @gligom 3 года назад +2

    Thank you! This is the best IdentityServer tutorial

    • @identityserver
      @identityserver  3 года назад

      Hi Claudiu! Thank you for the kind words!

  • @techrelated2417
    @techrelated2417 3 года назад +2

    One of the best tutorial. Simple explanation. Thanks so much for making them.

    • @identityserver
      @identityserver  3 года назад

      You're very welcome! Please feel to check out our other videos :)

  • @ivankurapica5615
    @ivankurapica5615 2 года назад +1

    It's really helping me to figure out how these things work. Thank for you your great work

    • @identityserver
      @identityserver  2 года назад

      Thanks Ivan! We try our best - we have a Duende IdentityServer tutorial coming soon. :)

  • @TheBest-sd2qf
    @TheBest-sd2qf 3 года назад +1

    Better than MS documentation, thanks for making this!

  • @pradeeppradyumna601
    @pradeeppradyumna601 2 года назад

    This video is very helpful. Thank you Kevin. I have been looking for a video on step by step implementation of IS4 and finally found one. Thank you so much

  • @Shinee3e
    @Shinee3e 3 года назад +4

    Honestly your tutorials are straight forward, clean and covering every aspect one of the best dev tutorials I've ever watched.
    Quick question otherwise, is there a grant for exchanging external provider's tokens with is4 tokens ?
    Thank you again :)

    • @ScottBrady91
      @ScottBrady91 3 года назад +3

      We recommend checking out token exchange. This would allow you to swap access tokens from a trusted 3rd party for ones issued by IdentityServer.
      Links:
      - Standard:tools.ietf.org/html/rfc8693
      - Write-up: www.scottbrady91.com/OAuth/Delegation-Patterns-for-OAuth-20

    • @Shinee3e
      @Shinee3e 3 года назад

      @@ScottBrady91 thanks a lot I will take a look at the articles, meanwhile would like to know your opinion if possible about this implementation I just found out :
      github.com/waqaskhan540/identityserver-token-exchange

  • @xarope6291
    @xarope6291 3 года назад

    Thank you so much, this helped me a lot !!! I have no acknowledgement in C# and I was able to build this from zero just watching the video and using the git code. Literally, this video is for everyone. THANK YOU SO MUCH!

    • @identityserver
      @identityserver  3 года назад

      Hi Xarope, Your comment has brought a big smile to our faces! Thank you very much for your kind words. :)

  • @EmersonArtwork
    @EmersonArtwork 2 года назад

    I can't understand what is said at 00:02:17 - how did you make the solution?

  • @marcosotto8424
    @marcosotto8424 3 года назад

    Best explanation I got about IdentityServer4. Thanks.......

  • @of_youtube
    @of_youtube 2 года назад +1

    Thanks a lot from Moscow!

  • @SpoderSuperhero
    @SpoderSuperhero 3 года назад +2

    This is a great tutorial - however I think that the 'bug' mentioned at ~13:35 where you have to use authentication before authorization makes sense - it seems impossible to authorize someone before you can confirm who they are.

  • @ahmeda5110
    @ahmeda5110 3 года назад

    Cool man.
    Question, is the consent page always necessary or can you just have a login username/password?

  • @Kravenhunter1
    @Kravenhunter1 3 года назад +1

    Could you help me? I tried to send the request in command lin does;nt work -
    curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "Cache-Control: no-cache" -d 'client_id=m2m.client&scope=weatherapi.read&client_secret=SuperSecretPassword&grant_type=client_credentials' "localhost:5000/connect/token"
    but it didn;t work. I got an error and it says - "Unable to convert "Content-Type: application/x-www-form-urlencoded" type "System.string" to "System.Collection.IDictionary" type. How can I fix it? Sorry for my English.

  • @arthurbenbassat
    @arthurbenbassat 2 года назад +2

    LOVEEEE

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

    Great, clean and clear.

  • @waseemwasfy5082
    @waseemwasfy5082 2 года назад

    Very clear and simple tutorial, thanks

  • @cuongnguyenduy7684
    @cuongnguyenduy7684 3 года назад +1

    Thank for sharing. Great tutorial.

  • @anthonyearlcuartero9734
    @anthonyearlcuartero9734 3 года назад

    Hi, I don't see refresh_token when it triggers connect/token endpoint. How can we retrieve it?

  • @taouichaimaa4355
    @taouichaimaa4355 2 года назад

    Hi , thank you for this but I can't get the .well-known/openid-configuration page to work, I get this page is unaccessible error. and when I tried to add the authorization, I still get access to the endpoints. anyone knows how to fix this?

  • @animajdb
    @animajdb 3 года назад

    Thanks for this great tutorial. I am having a problem I was hoping I could get some assistance with. After following your steps on setting up the IdentityServer and in memory resources, I try running the curl command from VSCode's PowerShell terminal but I get an error every time. (I found the comment where you gave the command and I used that but changed the port its run on to 5001, and it is running on https.) any tips or help would be greatly appreciated.
    Invoke-WebRequest : Cannot bind parameter 'Headers'. Cannot convert the "Content-Type: application/x-www-form-urlencoded" value of type "System.String" to type "System.Collections.IDictionary".
    At line:1 char:17
    + ... -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "Cac ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidArgument: (:) [Invoke-WebRequest], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

  • @tiendang5149
    @tiendang5149 2 года назад

    still hard to understand all of the setup, but it seems to provide an clear first look about it, thank anyway!

    • @identityserver
      @identityserver  2 года назад +1

      Hi Dang, If you have any suggestions on areas we can improve on, please let us know!

  • @anthonycuartero746
    @anthonycuartero746 3 года назад

    Hi, can you make a video instead of using TestUsers. Should used IdentityUser from localDb? Thanks

  • @akimbbo_upnext
    @akimbbo_upnext 2 года назад

    If you were to create simple production ready system (web api and mobile app as frontend), would you go with identity server or you would skip this and use simple solution like asp net core identity library within webapi?

    • @akimbbo_upnext
      @akimbbo_upnext 2 года назад

      Good tutorial anyways:)

    • @identityserver
      @identityserver  2 года назад +1

      Without fully understanding what you are trying to build, its complexities, its deployment location and how you plan to scale your solution. We wouldn't be able to give you the best advice for your solution. A core philosophy we like to follow, is that a simple secure solution is often better.

  • @yeasinabedin7115
    @yeasinabedin7115 3 года назад

    Thank you for this great tutorial! One of the best around I would say.
    Two question from me :
    1. @22:53, Line#44
    Does it mean, each time the client queries for weather data, it will also hit identityserver for a token?

    2. @27:47, Line#11
    Is it safe to keep this secret in client side?

    • @ScottBrady91
      @ScottBrady91 3 года назад +1

      1. That's correct. You would need to implement a caching layer around this service in order to re-use the access token
      2. The client application has to know the (plaintext) client secret to perform the code exchange. Some alternatives to storing it in local config would be to use a secure storage area, such as Azure Key Vault, or remove shared secrets completely by using one of the other client authentication types: www.scottbrady91.com/OAuth/Removing-Shared-Secrets-for-OAuth-Client-Authentication
      Hope that helps!

  • @asrajan55
    @asrajan55 2 года назад

    This part is very confusing. The WeatherMVC client and WeatherAPI client are 2 different applications.
    Why should the WeatherMVC client know the secret key of the WeatherAPI client in it's configuration file? (20:13)

  • @aSameplayer
    @aSameplayer 2 года назад

    Is it possible to add multiple auth providers so the user can choose a different loggin method?

    • @identityserver
      @identityserver  2 года назад

      Hi Sameplayer, Yes you can customise IdentityServer to enable different auth providers. For example, employees use their AD credentials to log in.

  • @MrDpk27
    @MrDpk27 3 года назад +1

    thank you sir!! great tutorial .

    • @identityserver
      @identityserver  3 года назад

      Hi Deepak, I am glad you found it helpful! Please feel free to check out our other videos!

  • @ImanRB
    @ImanRB 2 года назад

    Does anybody know how to authenticate a nodejs service with this identity server ?

  • @lamchowing
    @lamchowing 3 года назад +1

    Great tutorial. Could you create a tutorial for react project template? Most of the examples on the internet are MVC for some reasons.

    • @identityserver
      @identityserver  3 года назад +1

      Hi Joe, Thank you for the feedback! We didn't have any plans to create a tutorial for react. However, I have added it to our video backlog, to be discussed with the team. Thanks again!

  • @BikasSahu1431
    @BikasSahu1431 3 года назад

    Loved it .. U have made it so easy

  • @camiloandresgomezm.3021
    @camiloandresgomezm.3021 4 года назад +1

    Great tutorial. How can we get an access_token using the user credentials(username, password) I see 'password' grant type is not recommended, so what are the options?

    • @ScottBrady91
      @ScottBrady91 4 года назад +1

      Hi! The only way to swap user credentials for an access token via an API call would be to use the ROPC flow (the password grant type). It's a much better idea to use a user interactive flow, such as the authorization code flow. www.scottbrady91.com/OAuth/Why-the-Resource-Owner-Password-Credentials-Grant-Type-is-not-Authentication-nor-Suitable-for-Modern-Applications

  • @vamsikrishna4166
    @vamsikrishna4166 3 года назад

    How to use refresh token here ?? Plz

  • @guedriabdelkalek3946
    @guedriabdelkalek3946 2 года назад

    How to add Role , UserClaim , RoleClaim to the generated token ?

    • @identityserver
      @identityserver  2 года назад

      Hi Guedri, I see that you have opened a support ticket with us. I will be providing you with more information that way. - Cheers Kieran

  • @khaledrimawi2194
    @khaledrimawi2194 3 года назад

    Hi man , thnx for the tutorial . how do we refresh the token here ?

  • @DiegoRodriguezNava
    @DiegoRodriguezNava 3 года назад +1

    @ 10:54 starts writing a protected API

    • @DiegoRodriguezNava
      @DiegoRodriguezNava 3 года назад +1

      @ 15:29 How to access the API from a Web App using the token

  • @brandonmifsud2555
    @brandonmifsud2555 3 года назад

    Can this be done with Visual Studio?

    • @sebbec6006
      @sebbec6006 2 года назад

      yes, it can. just tried it

  • @nestormatias217
    @nestormatias217 3 года назад

    Hey i need some help when i use GET invalid bearer = "invalid token".... can someone help me????

    • @identityserver
      @identityserver  3 года назад

      Hi Nest, This might be a hard one to debug over RUclips Comments. Feel free to create a Stack Overflow question and ourselves or a member of the community should be able to help. If it is urgent we do provide consultancy services.

    • @nestormatias217
      @nestormatias217 3 года назад

      I’ve already fixed thanks anyway good courses

    • @identityserver
      @identityserver  3 года назад

      @@nestormatias217 Hi nest, Thank you for the kind words. Hope you have a fantastic day! :)

  • @rpcragesh
    @rpcragesh 3 года назад

    Great tutorial

  • @addtyu6176
    @addtyu6176 3 года назад +2

    What.... A white background?

    • @identityserver
      @identityserver  3 года назад

      Madness i know! - I prefer Kimbie Dark, what about you?

    • @addtyu6176
      @addtyu6176 3 года назад

      @@identityserver Yeah :) Dark = Programmer. Btw, how are people still using Identity Server? Isn't Google Firebase Auth 100% free now?

    • @addtyu6176
      @addtyu6176 3 года назад

      @@identityserver Ok i found out why myself... Firebase has many issues.. plus they also can't do ClientCredentials grant flow... so it's pretty useless

    • @identityserver
      @identityserver  3 года назад

      @@addtyu6176 I'm glad you managed to find out what was best! We haven't used Firebase before, so can't provide recommendations on its usage.

  • @aargomemnon
    @aargomemnon 4 года назад

    Can you also share a source code where we can follow the tutorial?

    • @identityserver
      @identityserver  4 года назад

      Hi Gama, Here is the link to the source code: github.com/kevinrjones/SettingUpIdentityServer

  • @jefersonfurrier4104
    @jefersonfurrier4104 3 года назад +1

    can you please give us that curl request?

    • @identityserver
      @identityserver  3 года назад +1

      Hi Jeferson, here is the curl request: $ curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "Cache-Control: no-cache" -d 'client_id=m2m.client&scope=weatherapi.read&client_secret=SuperSecretPassword&grant_type=client_credentials' "localhost:5443/connect/token"

    • @anydobre1796
      @anydobre1796 3 года назад

      @@identityserver Hello! Thanks for this video. The pace is great. I tried the above command, and I get back: "curl: (60) SSL certificate problem: unable to get local issuer certificate
      More details here: curl.haxx.se/docs/sslcerts.html
      curl failed to verify the legitimacy of the server and therefore could not
      establish a secure connection to it. To learn more about this situation and
      how to fix it, please visit the web page mentioned above."
      Any thoughts?

    • @anydobre1796
      @anydobre1796 3 года назад

      I managed to get this to work in Postman, where in Settings it has a disable SSL options. But using curl I didn't know how to fix it.
      As for the workaround in Postman, what is a better way to go about the certificate error? Suppose you are in a production environment.

    • @PauloDouglas
      @PauloDouglas 3 года назад

      @@anydobre1796 Add the --insecure arg to your request: $ curl --insecure -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "Cache-Control: no-cache" -d 'client_id=m2m.client&scope=weatherapi.read&client_secret=SuperSecretPassword&grant_type=client_credentials' "localhost:5443/connect/token"

  • @vivekgowda1576
    @vivekgowda1576 3 года назад

    Hi team, Thanks for the video. I have setup the identity server 4 with .net core 3.1
    Every thing is working fine but the thing is i need to do Redis caching for server side. Can you help me out :)

    • @ScottBrady91
      @ScottBrady91 3 года назад +1

      Hi! What kind of caching are you looking for? For IdentityServer configuration caching (e.g. clients and scopes), we recommend implementing your own storage layer than decorates the IdentityServer EF implementations. Check out how to create your own store here: www.scottbrady91.com/Identity-Server/Creating-Your-Own-IdentityServer4-Storage-Library
      There are some open-source Redis implementations from the community, but we don't have any experience with them.

    • @vivekgowda1576
      @vivekgowda1576 3 года назад

      @@ScottBrady91 actually I'm looking for both identity server configuration caching and client , scope and user

  • @gamelover5906
    @gamelover5906 2 года назад

    nice tutorial... here you are 1000 subscriber gift :)

  • @MrBigBawss21
    @MrBigBawss21 3 года назад

    If I were to request a token via a javascript framework library such as Angular instead of having an MVC app, wouldn't I have to leave the client secret somewhere in a javascript file? Assuming I'm not supposed to expose my client secret, (angular being client-side) how would I go on about this?

    • @ScottBrady91
      @ScottBrady91 3 года назад

      That's correct, a client secret wouldn't be all that secret within a browser-based SPA. Check out our recommendations for OAuth in browser-based applications: www.scottbrady91.com/OAuth/Cheat-Sheet-OAuth-for-Browser-Based-Applications

  • @amjster
    @amjster 4 года назад +3

    Great tutorial. This will be the reference video for my team to learn about IdentityServer. Well done...