"use strict";(self.webpackChunkspotify_api_docs=self.webpackChunkspotify_api_docs||[]).push([[1755],{3905:function(e,t,n){n.d(t,{Zo:function(){returnc},kt:function(){returnh}});varr=n(7294);functiono(e,t,n){returntine?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}functiona(e,t){varn=Object.keys(e);if(Object.getOwnPropertySymbols){varr=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){returnObject.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}returnn}functionp(e){for(vart=1;t<arguments.length;t++){varn=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}returne}functioni(e,t){if(null==e)return{};varn,r,o=function(e,t){if(null==e)return{};varn,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);returno}(e,t);if(Object.getOwnPropertySymbols){vara=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}returno}vars=r.createContext({}),l=function(e){vart=r.useContext(s),n=t;returne&&(n="function"==typeofe?e(t):p(p({},t),e)),n},c=function(e){vart=l(e.components);returnr.createElement(s.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){vart=e.children;returnr.createElement(r.Fragment,{},t)}},u=r.forwardRef((function(e,t){varn=e.components,o=e.mdxType,a=e.originalType,s=e.parentName,c=i(e,["components","mdxType","originalType","parentName"]),u=l(n),h=o,f=u["".concat(s,".").concat(h)]||u[h]||d[h]||a;returnn?r.createElement(f,p(p({ref:t},c),{},{components:n})):r.createElement(f,p({ref:t},c))}));functionh(e,t){varn=arguments,o=t&&t.mdxType;if("string"==typeofe||o){vara=n.length,p=newArray(a);p[0]=u;vari={};for(varsint)hasOwnProperty.call(t,s)&&(i[s]=t[s]);i.originalType=e,i.mdxType="string"==typeofe?e:o,p[1]=i;for(varl=2;l<a;l++)p[l]=n[l];returnr.createElement.apply(null,p)}returnr.createElement.apply(null,n)}u.displayName="MDXCreateElement"},2197:function(e,t,n){n.r(t),n.d(t,{assets:function(){returnc},contentTitle:function(){returns},default:function(){returnh},frontMatter:function(){returni},metadata:function(){returnl},toc:function(){returnd}});varr=n(7462),o=n(3366),a=(n(7294),n(3905)),p=["components"],i={id:"token_swap",title:"Token Swap"},s=void0,l={unversionedId:"token_swap",id:"token_swap",title:"Token Swap",description:"Token Swap provides an authenticatiow flow where client-side apps (like CLI/desktop/mobile apps) are still able to use long-living tokens and the opportunity to refresh them without exposing your application's secret. This however requires a server-side part to work.",source:"@site/docs/token_swap.md",sourceDirName:".",slug:"/token_swap",permalink:"/SpotifyAPI-NET/docs/token_swap",draft:!1,editUrl:"https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/docs/token_swap.md",tags:[],version:"current",lastUpdatedBy:"Jonas Dellinger",lastUpdatedAt:1685219501,formattedLastUpdatedAt:"May 27, 2023",frontMatter:{id:"token_swap",title:"Token Swap"},sidebar:"docs",previous:{title:"PKCE",permalink:"/SpotifyAPI-NET/docs/pkce"},next:{title:"Showcase",permalink:"/SpotifyAPI-NET/docs/showcase"}},c={},d=[{value:"Flow",id:"flow",level:2},{value:"Server Implementation",id:"server-implementation",level:2},{value:"Swap",id:"swap",level:3},{value:"Refresh",id:"refresh",level:3},{value:"Example",id:"example",level:2}],u={toc:d};functionh(e){vart=e.components,n=(0,o.Z)(e,p);return(0,a.kt)("wrapper",(0,r.Z)({},u,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"TokenSwapprovidesanauthenticatiowflowwhereclient-sideapps(likeCLI/desktop/mobileapps)arestillabletouselong-livingtokensandtheopportunitytorefreshthemwithoutexposingyourapplication'ssecret.Thishoweverrequiresaserver-sidepart