"use strict";(self.webpackChunkspotify_api_docs=self.webpackChunkspotify_api_docs||[]).push([[2244],{3905:function(e,t,r){r.d(t,{Zo:function(){returnc},kt:function(){returnf}});varn=r(7294);functiono(e,t,r){returntine?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}functiona(e,t){varr=Object.keys(e);if(Object.getOwnPropertySymbols){varn=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){returnObject.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}returnr}functioni(e){for(vart=1;t<arguments.length;t++){varr=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}returne}functionp(e,t){if(null==e)return{};varr,n,o=function(e,t){if(null==e)return{};varr,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);returno}(e,t);if(Object.getOwnPropertySymbols){vara=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}returno}vars=n.createContext({}),l=function(e){vart=n.useContext(s),r=t;returne&&(r="function"==typeofe?e(t):i(i({},t),e)),r},c=function(e){vart=l(e.components);returnn.createElement(s.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){vart=e.children;returnn.createElement(n.Fragment,{},t)}},d=n.forwardRef((function(e,t){varr=e.components,o=e.mdxType,a=e.originalType,s=e.parentName,c=p(e,["components","mdxType","originalType","parentName"]),d=l(r),f=o,m=d["".concat(s,".").concat(f)]||d[f]||u[f]||a;returnr?n.createElement(m,i(i({ref:t},c),{},{components:r})):n.createElement(m,i({ref:t},c))}));functionf(e,t){varr=arguments,o=t&&t.mdxType;if("string"==typeofe||o){vara=r.length,i=newArray(a);i[0]=d;varp={};for(varsint)hasOwnProperty.call(t,s)&&(p[s]=t[s]);p.originalType=e,p.mdxType="string"==typeofe?e:o,i[1]=p;for(varl=2;l<a;l++)i[l]=r[l];returnn.createElement.apply(null,i)}returnn.createElement.apply(null,r)}d.displayName="MDXCreateElement"},5969:function(e,t,r){r.r(t),r.d(t,{assets:function(){returnu},contentTitle:function(){returnl},default:function(){returnm},frontMatter:function(){returns},metadata:function(){returnc},toc:function(){returnd}});varn=r(7462),o=r(3366),a=(r(7294),r(3905)),i=r(4996),p=["components"],s={id:"example_asp",title:"ASP.NET"},l=void0,c={unversionedId:"example_asp",id:"example_asp",title:"ASP.NET",description:"Description",source:"@site/docs/example_asp.md",sourceDirName:".",slug:"/example_asp",permalink:"/SpotifyAPI-NET/docs/example_asp",draft:!1,editUrl:"https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/docs/example_asp.md",tags:[],version:"current",lastUpdatedBy:"Jonas Dellinger",lastUpdatedAt:1685219501,formattedLastUpdatedAt:"May 27, 2023",frontMatter:{id:"example_asp",title:"ASP.NET"},sidebar:"docs",previous:{title:"Showcase",permalink:"/SpotifyAPI-NET/docs/showcase"},next:{title:"Blazor WASM",permalink:"/SpotifyAPI-NET/docs/example_blazor_wasm"}},u={},d=[{value:"Description",id:"description",level:2},{value:"Run it",id:"run-it",level:2}],f={toc:d};functionm(e){vart=e.components,r=(0,o.Z)(e,p);return(0,a.kt)("wrapper",(0,n.Z)({},f,r,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h2",{id:"description"},"Description"),(0,a.kt)("p",null,"This example is based on ASP .NET Core. It uses ",(0,a.kt)("inlineCode",{parentName:"p"},"Authorization Code")," under the hood with the help of ",(0,a.kt)("a",{parentName:"p",href:"https://www.nuget.org/packages/AspNet.Security.OAuth.Spotify/"},(0,a.kt)("inlineCode",{parentName:"a"},"AspNet.Security.OAuth.Spotify")),". It stores the access token in the current user session (cookie-based) and allows to refresh tokens when they expire. Two pages are implemented:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"Homeshowsyourcurrentplaylistsviapagin