SummaryOAuth 2 in Action teaches you the practical use and deployment of this HTTPbased protocol from the perspectives of a client, authorization server, and resource server. You ll learn how to confidently and securely build and deploy OAuth on both the client and server sides. Foreword by Ian Glazer.Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.About the TechnologyThink of OAuth 2 as the web version of a valet key. It is an HTTPbased security protocol that allows users of a service to enable applications to use that service on their behalf without handing over full control. And OAuth is used everywhere, from Facebook and Google, to startups and cloud services.About the BookOAuth 2 in Action teaches you practical use and deployment of OAuth 2 from the perspectives of a client, an authorization server, and a resource server. You ll begin with an overview of OAuth and its components and interactions. Next, you ll get handson and build an OAuth client, an authorization server, and a protected resource. Then you ll dig into tokens, dynamic client registration, and more advanced topics. By the end, you ll be able to confidently and securely build and deploy OAuth on both the client and server sides.What s InsideCovers OAuth 2 protocol and design Authorization with OAuth 2 OpenID Connect and UserManaged Access Implementation risks JOSE, introspection, revocation, and registration Protecting and accessing REST APIsAbout the ReaderReaders need basic programming skills and knowledge of HTTP and JSON.About the AuthorJustin Richer is a systems architect and software engineer. Antonio Sanso is a security software engineer and a security researcher. Both authors contribute to open standards and open source.Table of ContentsPart 1 First steps What is OAuth 2.0 and why should you care? The OAuth dance Part 2 Building an OAuth 2 environment Building a simple OAuth client Building a simple OAuth protected resource Building a simple OAuth authorization server OAuth 2.0 in the real world Part 3 OAuth 2 implementation and vulnerabilities Common client vulnerabilities Common protected resources vulnerabilities Common authorization server vulnerabilities Common OAuth token vulnerabilities Part 4 Taking OAuth further OAuth tokens Dynamic client registration User authentication with OAuth 2.0 Protocols and profiles using OAuth 2.0 Beyond bearer tokens Summary and conclusions
⚠️ WARNING (California Proposition 65):
This product may contain chemicals known to the State of California to cause cancer,
birth defects, or other reproductive harm.
For more information, please visit
www.P65Warnings.ca.gov.
<div class="dynamic-checkout__content" id="dynamic-checkout-cart" data-shopify="dynamic-checkout-cart"> <shopify-accelerated-checkout-cart wallet-configs="[{"supports_subs":true,"supports_def_opts":false,"name":"shop_pay","wallet_params":{"shopId":73758048501,"merchantName":"Ergodebooks","personalized":true}},{"supports_subs":false,"supports_def_opts":false,"name":"amazon_pay","wallet_params":{"checkoutLanguage":"en_US","ledgerCurrency":"USD","placement":"Cart","sandbox":false,"merchantId":"A1G1ZY975O1T6J","productType":"PayAndShip","design":"C0002"}},{"supports_subs":true,"supports_def_opts":false,"name":"paypal","wallet_params":{"shopId":73758048501,"countryCode":"US","merchantName":"Ergodebooks","phoneRequired":true,"companyRequired":false,"shippingType":"shipping","shopifyPaymentsEnabled":true,"hasManagedSellingPlanState":false,"requiresBillingAgreement":false,"gatewayType":"MANAGED","merchantId":"L873BZSC9NMQS","sdkUrl":"https://www.paypal.com/sdk/js?components=buttons\u0026commit=false\u0026currency=USD\u0026locale=en_US\u0026client-id=AbasDhzlU0HbpiStJiN1KRJ_cNJJ7xYBip7JJoMO0GQpLi8ePNgdbLXkC7_KMeyTg8tnAKW4WKrh9qmf\u0026merchant-id=L873BZSC9NMQS\u0026intent=authorize","serviceableCountryCodes":["AC","AD","AE","AF","AG","AI","AL","AM","AO","AR","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GW","GY","HK","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MK","ML","MM","MN","MO","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PS","PT","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SZ","TA","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VN","VU","WF","WS","XK","YE","YT","ZA","ZM","ZW"]}},{"supports_subs":true,"supports_def_opts":false,"name":"google_pay","wallet_params":{"sdkUrl":"https://pay.google.com/gp/p/js/pay.js","paymentData":{"apiVersion":2,"apiVersionMinor":0,"shippingAddressParameters":{"allowedCountryCodes":["AC","AD","AE","AF","AG","AI","AL","AM","AO","AR","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GW","GY","HK","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MK","ML","MM","MN","MO","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PS","PT","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SZ","TA","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VN","VU","WF","WS","XK","YE","YT","ZA","ZM","ZW"],"phoneNumberRequired":true,"format":"FULL-ISO3166"},"merchantInfo":{"merchantName":"Ergodebooks","merchantId":"16708973830884969730","merchantOrigin":"ergodebooks.com"},"allowedPaymentMethods":[{"type":"CARD","parameters":{"allowedCardNetworks":["VISA","MASTERCARD","AMEX","DISCOVER","JCB"],"allowedAuthMethods":["PAN_ONLY","CRYPTOGRAM_3DS"],"billingAddressRequired":true,"billingAddressParameters":{"format":"FULL-ISO3166","phoneNumberRequired":true}},"tokenizationSpecification":{"type":"PAYMENT_GATEWAY","parameters":{"gateway":"shopify","gatewayMerchantId":"73758048501"}}}],"emailRequired":true},"customerAccountEmail":null,"environment":"PRODUCTION","availablePresentmentCurrencies":["USD"],"auth":[{"jwt":"eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiJ9.eyJtZXJjaGFudElkIjoiMTY3MDg5NzM4MzA4ODQ5Njk3MzAiLCJtZXJjaGFudE9yaWdpbiI6ImVyZ29kZWJvb2tzLmNvbSIsImlhdCI6MTc5NjI5MDE5MH0.dJiAJjaLxUSpib-8MLzEGpWgmkWw6Jh7SQM8rI6CHDCOTctdtd0_phleOoBFqukeZfkmWAccDragX0TW0O5kqg","expiresAt":1796333390},{"jwt":"eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiJ9.eyJtZXJjaGFudElkIjoiMTY3MDg5NzM4MzA4ODQ5Njk3MzAiLCJtZXJjaGFudE9yaWdpbiI6ImVyZ29kZWJvb2tzLmNvbSIsImlhdCI6MTc5NjMzMzM5MH0.CxFCy9bUTtevqVcvxyFIP9ea1aIxOn0VKD7rauxZKfRF6A2QGOpccUsz2eDK1YT6iqS71xWQAiAx2eZCPUqoBw","expiresAt":1796376590}],"cardsinkUrl":"https://checkout.pci.shopifyinc.com/sessions","cardsinkCallerIdentificationJwt":"eyJraWQiOiJ2MSIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJjbGllbnRfaWQiOiIxMSIsImNsaWVudF9hY2NvdW50X2lkIjoiNzM3NTgwNDg1MDEiLCJ1bmlxdWVfaWQiOiIwMU04WEtSN1NHM1BBODFRM1YxN0JGUEowRCIsImlhdCI6MTc5NjI5MDE5MH0.3RMyqzg54VgETbDpvF7sYchbhm2rDSoeb2hmXZ1K1cM"}}]" access-token="c0f52a66b386e9fa5c0ab4c2febc737c" buyer-country="US" buyer-locale="en" buyer-currency="USD" shop-id="73758048501" cart-id="hWNJr0NVWfBRK1Sp2Tav0bCs" enabled-flags="["66a6333b"]" requires-shipping > <div class="wallet-button-wrapper"> <ul class='wallet-cart-grid wallet-cart-grid--skeleton' role="list" data-shopify-buttoncontainer="true"> <li data-testid='grid-cell' class='wallet-cart-button-container'><div class='wallet-cart-button wallet-cart-button__skeleton' role='button' disabled aria-hidden='true'> </div></li><li data-testid='grid-cell' class='wallet-cart-button-container'><div class='wallet-cart-button wallet-cart-button__skeleton' role='button' disabled aria-hidden='true'> </div></li><li data-testid='grid-cell' class='wallet-cart-button-container'><div class='wallet-cart-button wallet-cart-button__skeleton' role='button' disabled aria-hidden='true'> </div></li><li data-testid='grid-cell' class='wallet-cart-button-container'><div class='wallet-cart-button wallet-cart-button__skeleton' role='button' disabled aria-hidden='true'> </div></li> </ul> </div> </shopify-accelerated-checkout-cart> </div>