﻿
{"id":18738,"date":"2020-10-31T17:39:00","date_gmt":"2020-10-31T17:39:00","guid":{"rendered":"https:\/\/www.gencayyildiz.com\/blog\/?p=18738"},"modified":"2020-10-31T17:39:00","modified_gmt":"2020-10-31T17:39:00","slug":"identityserver4-yazi-serisi-10-resource-owner-credentials-grantflow","status":"publish","type":"post","link":"https:\/\/www.gencayyildiz.com\/blog\/identityserver4-yazi-serisi-10-resource-owner-credentials-grantflow\/","title":{"rendered":"IdentityServer4 Yaz\u0131 Serisi #10 &#8211; Resource Owner Credentials Grant(Flow)"},"content":{"rendered":"<div id=\"fb-root\"><\/div>\n<p>Merhaba,<\/p>\n<p><a href=\"https:\/\/www.gencayyildiz.com\/blog\/identityserver4-yazi-serisi\/\" rel=\"noopener noreferrer\" target=\"_blank\">IdentityServer4 Yaz\u0131 Serisi<\/a>nin bu onuncu makalesinde IdentityServer4&#8217;de ki ak\u0131\u015f tiplerine devam ediyoruz. \u015eimdi ele alaca\u011f\u0131m\u0131z ak\u0131\u015f\u0131m\u0131z <em>Resource Owner Credentials Grant<\/em>&#8216;t\u0131r.<\/p>\n<h3 style=\"color:#e83e8c;\">Resource Owner Credentials Grant(Flow) Nedir?<\/h3>\n<blockquote><p><em>Bu ak\u0131\u015f kaynaklarda ayriyetten <em>Password Grant<\/em> olarakta ge\u00e7mektedir.<\/em><\/p><\/blockquote>\n<p><a href=\"https:\/\/www.gencayyildiz.com\/blog\/identityserver4-yazi-serisi-8-authorization-code-grantflow\/\" rel=\"noopener noreferrer\" target=\"_blank\">Authorization Code Grant<\/a> ve <a href=\"https:\/\/www.gencayyildiz.com\/blog\/identityserver4-yazi-serisi-9-implicit-grantflow\/\" rel=\"noopener noreferrer\" target=\"_blank\">Implicit Grant<\/a> ak\u0131\u015flar\u0131nda login olmak isteyen kullan\u0131c\u0131n\u0131n do\u011frulama i\u015flemlerini Auth Server&#8217;a y\u00f6nlendirerek ger\u00e7ekle\u015ftirmekteyiz. Genellikle bu tercihi t\u00fcm sistemin(clientlar, apiler, auth server vs.) taraf\u0131m\u0131zca geli\u015ftirilmedi\u011fi durumlarda el mahkum yapmam\u0131z gayet do\u011fald\u0131r. Lakin t\u00fcm sistemi biz geli\u015ftiriyorsak bu durumda kullan\u0131c\u0131y\u0131 login i\u015flemleri i\u00e7in client \u00fczerinden Auth Server&#8217;a y\u00f6nlendirmek yerine direkt olarak uygulama \u00fczerinde(arkaplanda\/backend&#8217;de) i\u015flemleri ger\u00e7ekle\u015ftirmek kullan\u0131c\u0131 a\u00e7\u0131s\u0131ndan daha uygun olabilir. Aksi taktirde kullan\u0131c\u0131y\u0131 ba\u015fka sayfaya y\u00f6nlendirmek ve orada yetkilendirme i\u015flemlerini ger\u00e7ekle\u015ftirdikten sonra yine geri client&#8217;a y\u00f6nlendirmek kullan\u0131c\u0131 deneyimi a\u00e7\u0131s\u0131ndan pek tercih edilmeyecek bir usuld\u00fcr.<\/p>\n<blockquote><p><em style=\"color:orange;\">Client say\u0131s\u0131n\u0131n \u00e7ok fazla oldu\u011fu durumlarda kullan\u0131c\u0131 kay\u0131t ve giri\u015f i\u015flemleri tek tek client&#8217;larda kodlanmak yerine Auth Server&#8217;da yap\u0131lmas\u0131 maliyet a\u00e7\u0131s\u0131ndan mant\u0131kl\u0131d\u0131r. Lakin client say\u0131s\u0131 g\u00f6rece azsa Auth Server&#8217;a y\u00f6nlendirmek kullan\u0131c\u0131 deneyimi a\u00e7\u0131s\u0131ndan pek makul de\u011fildir.<\/em><\/p><\/blockquote>\n<h3 style=\"color:#e83e8c;\">Resource Owner Credentials Grant Stratejisi Nas\u0131ld\u0131r?<\/h3>\n<p>Resource Owner Credentials Grant&#8217;ta bir client, kullan\u0131c\u0131y\u0131 direkt olarak y\u00f6nlendirme yapmaks\u0131z\u0131n Auth Server \u00fczerinden yetkilendirilir. Kullan\u0131c\u0131 ad\u0131 ve \u015fifresini token endpoint&#8217;e g\u00f6ndererek bir access token talep etmeye izin verir. Bu ak\u0131\u015f, kullan\u0131c\u0131 ile m\u00fc\u015fteri aras\u0131nda bir g\u00fcven ili\u015fkisi oldu\u011fu durumlarda uygundur.<\/p>\n<blockquote><p><em>Resource Owner Credentials Grant&#8217;da kullan\u0131c\u0131y\u0131 y\u00f6nlendirme olmad\u0131\u011f\u0131ndan ve bundan dolay\u0131 bilin\u00e7li bir etkile\u015fim yap\u0131lmad\u0131\u011f\u0131ndan dolay\u0131 genellikle \u00f6nerilmez.<\/em><\/p><\/blockquote>\n<p><a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2020\/10\/IdentityServer4-Yazi-Serisi-10-Resource-Owner-Credentials-GrantFlow.gif\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2020\/10\/IdentityServer4-Yazi-Serisi-10-Resource-Owner-Credentials-GrantFlow-300x139.gif\" alt=\"IdentityServer4 Yaz\u0131 Serisi #10 - Resource Owner Credentials Grant(Flow)\" width=\"300\" height=\"139\" class=\"alignleft size-medium wp-image-18772\" \/><\/a>Ak\u0131\u015f\u0131n ad\u0131mlar\u0131n\u0131 yandaki g\u00f6rsel e\u015fli\u011finde izah edersek;<\/p>\n<ul>\n<li><strong style=\"color:red;\">1.<\/strong> Kullan\u0131c\u0131(resource owner) client&#8217;a kullan\u0131c\u0131 ad\u0131 ve \u015fifresini verir.<\/li>\n<li><strong style=\"color:red;\">2.<\/strong> Client, Auth Server&#8217;\u0131n token endpoint&#8217;i arac\u0131l\u0131\u011f\u0131yla client cretentials(client kimlik bilgileri) ile birlikte kullan\u0131c\u0131dan al\u0131nan kimlik bilgileri e\u015fli\u011finde bir access token talebinde bulunur. <\/li>\n<li><strong style=\"color:red;\">3.<\/strong> Auth Server, kullan\u0131c\u0131 ve client kimlik bilgilerini do\u011frulad\u0131ktan sonra bir access token(ve hatta iste\u011fe ba\u011fl\u0131 olacak \u015fekilde refresh token) \u00fcreterek client&#8217;a g\u00f6nderirir.<\/li>\n<\/ul>\n<p>\u0130\u015fte bu kadar&#8230;<\/p>\n<p>\u0130lgilenenlerin faydalanmas\u0131 dile\u011fiyle&#8230;<br \/>\nSonraki yaz\u0131lar\u0131mda g\u00f6r\u00fc\u015fmek \u00fczere&#8230;<br \/>\n\u0130yi \u00e7al\u0131\u015fmalar&#8230;<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Merhaba, IdentityServer4 Yaz\u0131 Serisinin bu onuncu makalesinde IdentityServer4&#8217;de ki ak\u0131\u015f tiplerine devam ediyoruz. \u015eimdi ele alaca\u011f\u0131m\u0131z ak\u0131\u015f\u0131m\u0131z Resource Owner Credentials Grant&#8216;t\u0131r. Resource Owner Credentials Grant(Flow) Nedir? Bu ak\u0131\u015f kaynaklarda ayriyetten Password Grant olarakta ge\u00e7mektedir.&#46;&#46;&#46;<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":18168,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3826],"tags":[3886,3885,3883,3884],"class_list":["post-18738","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-identityserver4","tag-identityserver4-password-grant","tag-identityserver4-resource-owner-credentials-grant","tag-password-grant","tag-resource-owner-credentials-grant"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/18738","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/comments?post=18738"}],"version-history":[{"count":23,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/18738\/revisions"}],"predecessor-version":[{"id":18778,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/18738\/revisions\/18778"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/media\/18168"}],"wp:attachment":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/media?parent=18738"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/categories?post=18738"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/tags?post=18738"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}