mirror of
https://github.com/Sarsoo/Spotify.NET.git
synced 2024-12-23 22:56:25 +00:00
Deploy website - based on aab8c5ddcb
This commit is contained in:
parent
d597eb971b
commit
5bbe48b33a
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
|||||||
(window.webpackJsonp=window.webpackJsonp||[]).push([[13],{145:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return o})),n.d(t,"metadata",(function(){return c})),n.d(t,"rightToc",(function(){return l})),n.d(t,"default",(function(){return p}));var r=n(2),i=n(9),a=(n(0),n(188)),o={id:"utilities",title:"Utilities",sidebar_label:"Utilities"},c={id:"version-5.1.1/web/utilities",title:"Utilities",description:"Paging-Methods",source:"@site/versioned_docs/version-5.1.1/web/utilities.md",permalink:"/SpotifyAPI-NET/docs/web/utilities",editUrl:"https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/versioned_docs/version-5.1.1/web/utilities.md",version:"5.1.1",lastUpdatedBy:"Jonas Dellinger",lastUpdatedAt:1614683995,sidebar_label:"Utilities",sidebar:"version-5.1.1/someSidebar",previous:{title:"Tracks",permalink:"/SpotifyAPI-NET/docs/web/tracks"},next:{title:"Getting Started",permalink:"/SpotifyAPI-NET/docs/auth/getting_started"}},l=[{value:"Paging-Methods",id:"paging-methods",children:[]}],s={rightToc:l};function p(e){var t=e.components,n=Object(i.a)(e,["components"]);return Object(a.b)("wrapper",Object(r.a)({},s,n,{components:t,mdxType:"MDXLayout"}),Object(a.b)("h2",{id:"paging-methods"},"Paging-Methods"),Object(a.b)("p",null,"The ",Object(a.b)("inlineCode",{parentName:"p"},"SpotifyWebAPI")," features two paging-helper Methods, ",Object(a.b)("inlineCode",{parentName:"p"},"GetNextPage(Paging<T> page)")," and ",Object(a.b)("inlineCode",{parentName:"p"},"GetPreviousPage(Paging<T> page)"),".\nBoth are an easy way to receive the next/previous page of a Paging-Object."),Object(a.b)("p",null,"Sample:"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-csharp"}),'var playlistTracks = _spotify.GetPlaylistTracks("1122095781", "4EcNf2l8rXInbJOf3tQdgU", "", 50);\nwhile (true)\n{\n Console.WriteLine(playlistTracks.Items.Count);\n if (!playlistTracks.HasNextPage())\n break;\n playlistTracks = _spotify.GetNextPage(playlistTracks);\n}\n')))}p.isMDXComponent=!0},188:function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return f}));var r=n(0),i=n.n(r);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var s=i.a.createContext({}),p=function(e){var t=i.a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):c({},t,{},e)),n},u=function(e){var t=p(e.components);return i.a.createElement(s.Provider,{value:t},e.children)},b={inlineCode:"code",wrapper:function(e){var t=e.children;return i.a.createElement(i.a.Fragment,{},t)}},d=Object(r.forwardRef)((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,o=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),u=p(n),d=r,f=u["".concat(o,".").concat(d)]||u[d]||b[d]||a;return n?i.a.createElement(f,c({ref:t},s,{components:n})):i.a.createElement(f,c({ref:t},s))}));function f(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,o=new Array(a);o[0]=d;var c={};for(var l in t)hasOwnProperty.call(t,l)&&(c[l]=t[l]);c.originalType=e,c.mdxType="string"==typeof e?e:r,o[1]=c;for(var s=2;s<a;s++)o[s]=n[s];return i.a.createElement.apply(null,o)}return i.a.createElement.apply(null,n)}d.displayName="MDXCreateElement"}}]);
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[13],{145:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return o})),n.d(t,"metadata",(function(){return c})),n.d(t,"rightToc",(function(){return l})),n.d(t,"default",(function(){return p}));var r=n(2),i=n(9),a=(n(0),n(188)),o={id:"utilities",title:"Utilities",sidebar_label:"Utilities"},c={id:"version-5.1.1/web/utilities",title:"Utilities",description:"Paging-Methods",source:"@site/versioned_docs/version-5.1.1/web/utilities.md",permalink:"/SpotifyAPI-NET/docs/web/utilities",editUrl:"https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/versioned_docs/version-5.1.1/web/utilities.md",version:"5.1.1",lastUpdatedBy:"Jonas Dellinger",lastUpdatedAt:1614760606,sidebar_label:"Utilities",sidebar:"version-5.1.1/someSidebar",previous:{title:"Tracks",permalink:"/SpotifyAPI-NET/docs/web/tracks"},next:{title:"Getting Started",permalink:"/SpotifyAPI-NET/docs/auth/getting_started"}},l=[{value:"Paging-Methods",id:"paging-methods",children:[]}],s={rightToc:l};function p(e){var t=e.components,n=Object(i.a)(e,["components"]);return Object(a.b)("wrapper",Object(r.a)({},s,n,{components:t,mdxType:"MDXLayout"}),Object(a.b)("h2",{id:"paging-methods"},"Paging-Methods"),Object(a.b)("p",null,"The ",Object(a.b)("inlineCode",{parentName:"p"},"SpotifyWebAPI")," features two paging-helper Methods, ",Object(a.b)("inlineCode",{parentName:"p"},"GetNextPage(Paging<T> page)")," and ",Object(a.b)("inlineCode",{parentName:"p"},"GetPreviousPage(Paging<T> page)"),".\nBoth are an easy way to receive the next/previous page of a Paging-Object."),Object(a.b)("p",null,"Sample:"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-csharp"}),'var playlistTracks = _spotify.GetPlaylistTracks("1122095781", "4EcNf2l8rXInbJOf3tQdgU", "", 50);\nwhile (true)\n{\n Console.WriteLine(playlistTracks.Items.Count);\n if (!playlistTracks.HasNextPage())\n break;\n playlistTracks = _spotify.GetNextPage(playlistTracks);\n}\n')))}p.isMDXComponent=!0},188:function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return f}));var r=n(0),i=n.n(r);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var s=i.a.createContext({}),p=function(e){var t=i.a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):c({},t,{},e)),n},u=function(e){var t=p(e.components);return i.a.createElement(s.Provider,{value:t},e.children)},b={inlineCode:"code",wrapper:function(e){var t=e.children;return i.a.createElement(i.a.Fragment,{},t)}},d=Object(r.forwardRef)((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,o=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),u=p(n),d=r,f=u["".concat(o,".").concat(d)]||u[d]||b[d]||a;return n?i.a.createElement(f,c({ref:t},s,{components:n})):i.a.createElement(f,c({ref:t},s))}));function f(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,o=new Array(a);o[0]=d;var c={};for(var l in t)hasOwnProperty.call(t,l)&&(c[l]=t[l]);c.originalType=e,c.mdxType="string"==typeof e?e:r,o[1]=c;for(var s=2;s<a;s++)o[s]=n[s];return i.a.createElement.apply(null,o)}return i.a.createElement.apply(null,n)}d.displayName="MDXCreateElement"}}]);
|
@ -1 +1 @@
|
|||||||
(window.webpackJsonp=window.webpackJsonp||[]).push([[14],{146:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return i})),n.d(t,"metadata",(function(){return c})),n.d(t,"rightToc",(function(){return p})),n.d(t,"default",(function(){return l}));var r=n(2),a=n(9),o=(n(0),n(188)),i={id:"implicit_grant",title:"Implicit Grant",sidebar_label:"Implicit Grant"},c={id:"version-5.1.1/auth/implicit_grant",title:"Implicit Grant",description:"This way is recommended and the only auth-process which does not need a server-side exchange of keys. With this approach, you directly get a Token object after the user authed your application.",source:"@site/versioned_docs/version-5.1.1/auth/implicit_grant.md",permalink:"/SpotifyAPI-NET/docs/auth/implicit_grant",editUrl:"https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/versioned_docs/version-5.1.1/auth/implicit_grant.md",version:"5.1.1",lastUpdatedBy:"Jonas Dellinger",lastUpdatedAt:1614683995,sidebar_label:"Implicit Grant",sidebar:"version-5.1.1/someSidebar",previous:{title:"Getting Started",permalink:"/SpotifyAPI-NET/docs/auth/getting_started"},next:{title:"Authorization Code",permalink:"/SpotifyAPI-NET/docs/auth/authorization_code"}},p=[],s={rightToc:p};function l(e){var t=e.components,n=Object(a.a)(e,["components"]);return Object(o.b)("wrapper",Object(r.a)({},s,n,{components:t,mdxType:"MDXLayout"}),Object(o.b)("p",null,"This way is ",Object(o.b)("strong",{parentName:"p"},"recommended"),' and the only auth-process which does not need a server-side exchange of keys. With this approach, you directly get a Token object after the user authed your application.\nYou won\'t be able to refresh the token. If you want to use the internal Http server, please add "http://localhost:YOURPORT" to your application redirect URIs.'),Object(o.b)("p",null,"More info: ",Object(o.b)("a",Object(r.a)({parentName:"p"},{href:"https://developer.spotify.com/documentation/general/guides/authorization-guide/#implicit-grant-flow"}),"here")),Object(o.b)("pre",null,Object(o.b)("code",Object(r.a)({parentName:"pre"},{className:"language-csharp"}),'static async void Main(string[] args)\n{\n ImplicitGrantAuth auth = new ImplicitGrantAuth(\n _clientId,\n "http://localhost:4002",\n "http://localhost:4002",\n Scope.UserReadPrivate\n );\n auth.AuthReceived += async (sender, payload) =>\n {\n auth.Stop(); // `sender` is also the auth instance\n SpotifyWebAPI api = new SpotifyWebAPI()\n {\n TokenType = payload.TokenType,\n AccessToken = payload.AccessToken\n };\n // Do requests with API client\n };\n auth.Start(); // Starts an internal HTTP Server\n auth.OpenBrowser();\n}\n')))}l.isMDXComponent=!0},188:function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return f}));var r=n(0),a=n.n(r);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=a.a.createContext({}),l=function(e){var t=a.a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):c({},t,{},e)),n},u=function(e){var t=l(e.components);return a.a.createElement(s.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},h=Object(r.forwardRef)((function(e,t){var n=e.components,r=e.mdxType,o=e.originalType,i=e.parentName,s=p(e,["components","mdxType","originalType","parentName"]),u=l(n),h=r,f=u["".concat(i,".").concat(h)]||u[h]||d[h]||o;return n?a.a.createElement(f,c({ref:t},s,{components:n})):a.a.createElement(f,c({ref:t},s))}));function f(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=n.length,i=new Array(o);i[0]=h;var c={};for(var p in t)hasOwnProperty.call(t,p)&&(c[p]=t[p]);c.originalType=e,c.mdxType="string"==typeof e?e:r,i[1]=c;for(var s=2;s<o;s++)i[s]=n[s];return a.a.createElement.apply(null,i)}return a.a.createElement.apply(null,n)}h.displayName="MDXCreateElement"}}]);
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[14],{146:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return i})),n.d(t,"metadata",(function(){return c})),n.d(t,"rightToc",(function(){return p})),n.d(t,"default",(function(){return l}));var r=n(2),a=n(9),o=(n(0),n(188)),i={id:"implicit_grant",title:"Implicit Grant",sidebar_label:"Implicit Grant"},c={id:"version-5.1.1/auth/implicit_grant",title:"Implicit Grant",description:"This way is recommended and the only auth-process which does not need a server-side exchange of keys. With this approach, you directly get a Token object after the user authed your application.",source:"@site/versioned_docs/version-5.1.1/auth/implicit_grant.md",permalink:"/SpotifyAPI-NET/docs/auth/implicit_grant",editUrl:"https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/versioned_docs/version-5.1.1/auth/implicit_grant.md",version:"5.1.1",lastUpdatedBy:"Jonas Dellinger",lastUpdatedAt:1614760606,sidebar_label:"Implicit Grant",sidebar:"version-5.1.1/someSidebar",previous:{title:"Getting Started",permalink:"/SpotifyAPI-NET/docs/auth/getting_started"},next:{title:"Authorization Code",permalink:"/SpotifyAPI-NET/docs/auth/authorization_code"}},p=[],s={rightToc:p};function l(e){var t=e.components,n=Object(a.a)(e,["components"]);return Object(o.b)("wrapper",Object(r.a)({},s,n,{components:t,mdxType:"MDXLayout"}),Object(o.b)("p",null,"This way is ",Object(o.b)("strong",{parentName:"p"},"recommended"),' and the only auth-process which does not need a server-side exchange of keys. With this approach, you directly get a Token object after the user authed your application.\nYou won\'t be able to refresh the token. If you want to use the internal Http server, please add "http://localhost:YOURPORT" to your application redirect URIs.'),Object(o.b)("p",null,"More info: ",Object(o.b)("a",Object(r.a)({parentName:"p"},{href:"https://developer.spotify.com/documentation/general/guides/authorization-guide/#implicit-grant-flow"}),"here")),Object(o.b)("pre",null,Object(o.b)("code",Object(r.a)({parentName:"pre"},{className:"language-csharp"}),'static async void Main(string[] args)\n{\n ImplicitGrantAuth auth = new ImplicitGrantAuth(\n _clientId,\n "http://localhost:4002",\n "http://localhost:4002",\n Scope.UserReadPrivate\n );\n auth.AuthReceived += async (sender, payload) =>\n {\n auth.Stop(); // `sender` is also the auth instance\n SpotifyWebAPI api = new SpotifyWebAPI()\n {\n TokenType = payload.TokenType,\n AccessToken = payload.AccessToken\n };\n // Do requests with API client\n };\n auth.Start(); // Starts an internal HTTP Server\n auth.OpenBrowser();\n}\n')))}l.isMDXComponent=!0},188:function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return f}));var r=n(0),a=n.n(r);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=a.a.createContext({}),l=function(e){var t=a.a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):c({},t,{},e)),n},u=function(e){var t=l(e.components);return a.a.createElement(s.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},h=Object(r.forwardRef)((function(e,t){var n=e.components,r=e.mdxType,o=e.originalType,i=e.parentName,s=p(e,["components","mdxType","originalType","parentName"]),u=l(n),h=r,f=u["".concat(i,".").concat(h)]||u[h]||d[h]||o;return n?a.a.createElement(f,c({ref:t},s,{components:n})):a.a.createElement(f,c({ref:t},s))}));function f(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=n.length,i=new Array(o);i[0]=h;var c={};for(var p in t)hasOwnProperty.call(t,p)&&(c[p]=t[p]);c.originalType=e,c.mdxType="string"==typeof e?e:r,i[1]=c;for(var s=2;s<o;s++)i[s]=n[s];return a.a.createElement.apply(null,i)}return a.a.createElement.apply(null,n)}h.displayName="MDXCreateElement"}}]);
|
@ -1 +1 @@
|
|||||||
(window.webpackJsonp=window.webpackJsonp||[]).push([[15],{147:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return c})),n.d(t,"metadata",(function(){return a})),n.d(t,"rightToc",(function(){return p})),n.d(t,"default",(function(){return s}));var r=n(2),o=n(9),i=(n(0),n(188)),c={id:"example_cli_persistent_config",title:"CLI - Persistent Config"},a={id:"example_cli_persistent_config",title:"CLI - Persistent Config",source:"@site/docs/example_cli_persistent_config.md",permalink:"/SpotifyAPI-NET/docs/next/example_cli_persistent_config",editUrl:"https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/docs/example_cli_persistent_config.md",version:"next",lastUpdatedBy:"Jonas Dellinger",lastUpdatedAt:1614683995,sidebar:"docs",previous:{title:"CLI - Custom HTML",permalink:"/SpotifyAPI-NET/docs/next/example_cli_custom_html"},next:{title:"Token Swap",permalink:"/SpotifyAPI-NET/docs/next/example_token_swap"}},p=[],l={rightToc:p};function s(e){var t=e.components,n=Object(o.a)(e,["components"]);return Object(i.b)("wrapper",Object(r.a)({},l,n,{components:t,mdxType:"MDXLayout"}))}s.isMDXComponent=!0},188:function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return d}));var r=n(0),o=n.n(r);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var l=o.a.createContext({}),s=function(e){var t=o.a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):a({},t,{},e)),n},u=function(e){var t=s(e.components);return o.a.createElement(l.Provider,{value:t},e.children)},f={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},m=Object(r.forwardRef)((function(e,t){var n=e.components,r=e.mdxType,i=e.originalType,c=e.parentName,l=p(e,["components","mdxType","originalType","parentName"]),u=s(n),m=r,d=u["".concat(c,".").concat(m)]||u[m]||f[m]||i;return n?o.a.createElement(d,a({ref:t},l,{components:n})):o.a.createElement(d,a({ref:t},l))}));function d(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=n.length,c=new Array(i);c[0]=m;var a={};for(var p in t)hasOwnProperty.call(t,p)&&(a[p]=t[p]);a.originalType=e,a.mdxType="string"==typeof e?e:r,c[1]=a;for(var l=2;l<i;l++)c[l]=n[l];return o.a.createElement.apply(null,c)}return o.a.createElement.apply(null,n)}m.displayName="MDXCreateElement"}}]);
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[15],{147:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return c})),n.d(t,"metadata",(function(){return a})),n.d(t,"rightToc",(function(){return p})),n.d(t,"default",(function(){return s}));var r=n(2),o=n(9),i=(n(0),n(188)),c={id:"example_cli_persistent_config",title:"CLI - Persistent Config"},a={id:"example_cli_persistent_config",title:"CLI - Persistent Config",source:"@site/docs/example_cli_persistent_config.md",permalink:"/SpotifyAPI-NET/docs/next/example_cli_persistent_config",editUrl:"https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/docs/example_cli_persistent_config.md",version:"next",lastUpdatedBy:"Jonas Dellinger",lastUpdatedAt:1614760606,sidebar:"docs",previous:{title:"CLI - Custom HTML",permalink:"/SpotifyAPI-NET/docs/next/example_cli_custom_html"},next:{title:"Token Swap",permalink:"/SpotifyAPI-NET/docs/next/example_token_swap"}},p=[],l={rightToc:p};function s(e){var t=e.components,n=Object(o.a)(e,["components"]);return Object(i.b)("wrapper",Object(r.a)({},l,n,{components:t,mdxType:"MDXLayout"}))}s.isMDXComponent=!0},188:function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return d}));var r=n(0),o=n.n(r);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var l=o.a.createContext({}),s=function(e){var t=o.a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):a({},t,{},e)),n},u=function(e){var t=s(e.components);return o.a.createElement(l.Provider,{value:t},e.children)},f={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},m=Object(r.forwardRef)((function(e,t){var n=e.components,r=e.mdxType,i=e.originalType,c=e.parentName,l=p(e,["components","mdxType","originalType","parentName"]),u=s(n),m=r,d=u["".concat(c,".").concat(m)]||u[m]||f[m]||i;return n?o.a.createElement(d,a({ref:t},l,{components:n})):o.a.createElement(d,a({ref:t},l))}));function d(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=n.length,c=new Array(i);c[0]=m;var a={};for(var p in t)hasOwnProperty.call(t,p)&&(a[p]=t[p]);a.originalType=e,a.mdxType="string"==typeof e?e:r,c[1]=a;for(var l=2;l<i;l++)c[l]=n[l];return o.a.createElement.apply(null,c)}return o.a.createElement.apply(null,n)}m.displayName="MDXCreateElement"}}]);
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
|||||||
(window.webpackJsonp=window.webpackJsonp||[]).push([[21],{153:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return i})),n.d(t,"metadata",(function(){return c})),n.d(t,"rightToc",(function(){return l})),n.d(t,"default",(function(){return s}));var r=n(2),o=n(9),a=(n(0),n(188)),i={id:"logging",title:"Logging"},c={id:"logging",title:"Logging",description:"The library provides a way to inject your own, custom HTTP Logger. By default, no logging is performed.",source:"@site/docs/logging.md",permalink:"/SpotifyAPI-NET/docs/next/logging",editUrl:"https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/docs/logging.md",version:"next",lastUpdatedBy:"Jonas Dellinger",lastUpdatedAt:1614683995,sidebar:"docs",previous:{title:"Configuration",permalink:"/SpotifyAPI-NET/docs/next/configuration"},next:{title:"Proxy",permalink:"/SpotifyAPI-NET/docs/next/proxy"}},l=[{value:"SimpleConsoleHTTPLogger",id:"simpleconsolehttplogger",children:[]}],p={rightToc:l};function s(e){var t=e.components,n=Object(o.a)(e,["components"]);return Object(a.b)("wrapper",Object(r.a)({},p,n,{components:t,mdxType:"MDXLayout"}),Object(a.b)("p",null,"The library provides a way to inject your own, custom HTTP Logger. By default, no logging is performed."),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-csharp"}),'var config = SpotifyClientConfig\n .CreateDefault("YourAccessToken")\n .WithHTTPLogger(new YourHTTPLogger());\n\nvar spotify = new SpotifyClient(config);\n')),Object(a.b)("p",null,"The ",Object(a.b)("inlineCode",{parentName:"p"},"IHTTPLogger")," interface can be found ",Object(a.b)("a",Object(r.a)({parentName:"p"},{href:"https://github.com/JohnnyCrazy/SpotifyAPI-NET/blob/master/SpotifyAPI.Web/Http/Interfaces/IHTTPLogger.cs"}),"here"),"."),Object(a.b)("h2",{id:"simpleconsolehttplogger"},"SimpleConsoleHTTPLogger"),Object(a.b)("p",null,"The library ships with a simple console-based logger."),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-csharp"}),'var config = SpotifyClientConfig\n .CreateDefault("YourAccessToken")\n .WithHTTPLogger(new SimpleConsoleHTTPLogger());\n\nvar spotify = new SpotifyClient(config);\n')),Object(a.b)("p",null,"This logger produces a simple console output for debugging purposes:"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-text"}),'GET tracks/NotAnid []\n--\x3e BadRequest application/json { "error" : { "status" : 400, "message" : "\n\nGET tracks/6YlOxoHWLjH6uVQvxUIUug []\n--\x3e OK application/json { "album" : { "album_type" : "album", "arti\n')))}s.isMDXComponent=!0},188:function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return b}));var r=n(0),o=n.n(r);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=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])}return o}var p=o.a.createContext({}),s=function(e){var t=o.a.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):c({},t,{},e)),n},u=function(e){var t=s(e.components);return o.a.createElement(p.Provider,{value:t},e.children)},g={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},f=Object(r.forwardRef)((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,i=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),u=s(n),f=r,b=u["".concat(i,".").concat(f)]||u[f]||g[f]||a;return n?o.a.createElement(b,c({ref:t},p,{components:n})):o.a.createElement(b,c({ref:t},p))}));function b(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,i=new Array(a);i[0]=f;var c={};for(var l in t)hasOwnProperty.call(t,l)&&(c[l]=t[l]);c.originalType=e,c.mdxType="string"==typeof e?e:r,i[1]=c;for(var p=2;p<a;p++)i[p]=n[p];return o.a.createElement.apply(null,i)}return o.a.createElement.apply(null,n)}f.displayName="MDXCreateElement"}}]);
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[21],{153:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return i})),n.d(t,"metadata",(function(){return c})),n.d(t,"rightToc",(function(){return l})),n.d(t,"default",(function(){return s}));var r=n(2),o=n(9),a=(n(0),n(188)),i={id:"logging",title:"Logging"},c={id:"logging",title:"Logging",description:"The library provides a way to inject your own, custom HTTP Logger. By default, no logging is performed.",source:"@site/docs/logging.md",permalink:"/SpotifyAPI-NET/docs/next/logging",editUrl:"https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/docs/logging.md",version:"next",lastUpdatedBy:"Jonas Dellinger",lastUpdatedAt:1614760606,sidebar:"docs",previous:{title:"Configuration",permalink:"/SpotifyAPI-NET/docs/next/configuration"},next:{title:"Proxy",permalink:"/SpotifyAPI-NET/docs/next/proxy"}},l=[{value:"SimpleConsoleHTTPLogger",id:"simpleconsolehttplogger",children:[]}],p={rightToc:l};function s(e){var t=e.components,n=Object(o.a)(e,["components"]);return Object(a.b)("wrapper",Object(r.a)({},p,n,{components:t,mdxType:"MDXLayout"}),Object(a.b)("p",null,"The library provides a way to inject your own, custom HTTP Logger. By default, no logging is performed."),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-csharp"}),'var config = SpotifyClientConfig\n .CreateDefault("YourAccessToken")\n .WithHTTPLogger(new YourHTTPLogger());\n\nvar spotify = new SpotifyClient(config);\n')),Object(a.b)("p",null,"The ",Object(a.b)("inlineCode",{parentName:"p"},"IHTTPLogger")," interface can be found ",Object(a.b)("a",Object(r.a)({parentName:"p"},{href:"https://github.com/JohnnyCrazy/SpotifyAPI-NET/blob/master/SpotifyAPI.Web/Http/Interfaces/IHTTPLogger.cs"}),"here"),"."),Object(a.b)("h2",{id:"simpleconsolehttplogger"},"SimpleConsoleHTTPLogger"),Object(a.b)("p",null,"The library ships with a simple console-based logger."),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-csharp"}),'var config = SpotifyClientConfig\n .CreateDefault("YourAccessToken")\n .WithHTTPLogger(new SimpleConsoleHTTPLogger());\n\nvar spotify = new SpotifyClient(config);\n')),Object(a.b)("p",null,"This logger produces a simple console output for debugging purposes:"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-text"}),'GET tracks/NotAnid []\n--\x3e BadRequest application/json { "error" : { "status" : 400, "message" : "\n\nGET tracks/6YlOxoHWLjH6uVQvxUIUug []\n--\x3e OK application/json { "album" : { "album_type" : "album", "arti\n')))}s.isMDXComponent=!0},188:function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return b}));var r=n(0),o=n.n(r);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=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])}return o}var p=o.a.createContext({}),s=function(e){var t=o.a.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):c({},t,{},e)),n},u=function(e){var t=s(e.components);return o.a.createElement(p.Provider,{value:t},e.children)},g={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},f=Object(r.forwardRef)((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,i=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),u=s(n),f=r,b=u["".concat(i,".").concat(f)]||u[f]||g[f]||a;return n?o.a.createElement(b,c({ref:t},p,{components:n})):o.a.createElement(b,c({ref:t},p))}));function b(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,i=new Array(a);i[0]=f;var c={};for(var l in t)hasOwnProperty.call(t,l)&&(c[l]=t[l]);c.originalType=e,c.mdxType="string"==typeof e?e:r,i[1]=c;for(var p=2;p<a;p++)i[p]=n[p];return o.a.createElement.apply(null,i)}return o.a.createElement.apply(null,n)}f.displayName="MDXCreateElement"}}]);
|
File diff suppressed because one or more lines are too long
4
404.html
4
404.html
@ -6,14 +6,14 @@
|
|||||||
<meta name="generator" content="Docusaurus v2.0.0-alpha.56">
|
<meta name="generator" content="Docusaurus v2.0.0-alpha.56">
|
||||||
<title data-react-helmet="true">Page Not Found | SpotifyAPI-NET</title><meta data-react-helmet="true" property="og:title" content="Page Not Found | SpotifyAPI-NET"><meta data-react-helmet="true" name="twitter:card" content="summary_large_image"><link data-react-helmet="true" rel="shortcut icon" href="/SpotifyAPI-NET/img/favicon.ico"><link rel="stylesheet" href="/SpotifyAPI-NET/styles.8a053330.css">
|
<title data-react-helmet="true">Page Not Found | SpotifyAPI-NET</title><meta data-react-helmet="true" property="og:title" content="Page Not Found | SpotifyAPI-NET"><meta data-react-helmet="true" name="twitter:card" content="summary_large_image"><link data-react-helmet="true" rel="shortcut icon" href="/SpotifyAPI-NET/img/favicon.ico"><link rel="stylesheet" href="/SpotifyAPI-NET/styles.8a053330.css">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/styles.20e5fb07.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/styles.20e5fb07.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/runtime~main.df71fe3f.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/runtime~main.059d8efb.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/main.b4c50bf9.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/main.b4c50bf9.js" as="script">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=window.matchMedia("(prefers-color-scheme: dark)"),n=function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();null!==n?t(n):e.matches&&t("dark")}()</script><div id="__docusaurus">
|
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=window.matchMedia("(prefers-color-scheme: dark)"),n=function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();null!==n?t(n):e.matches&&t("dark")}()</script><div id="__docusaurus">
|
||||||
<nav class="navbar navbar--light navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><div aria-label="Navigation bar toggle" class="navbar__toggle" role="button" tabindex="0"><svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 30 30" role="img" focusable="false"><title>Menu</title><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></div><a class="navbar__brand" href="/SpotifyAPI-NET/"><img class="navbar__logo" src="/SpotifyAPI-NET/img/logo.svg" alt="SpotifyAPI-NET"><strong class="navbar__title">SpotifyAPI-NET</strong></a><div class="navbar__item dropdown dropdown--hoverable dropdown--left"><a activeclassname="navbar__link--active" class="navbar__item navbar__link">Docs</a><ul class="dropdown__menu"><li><a class="dropdown__link" href="/SpotifyAPI-NET/docs/next/introduction">Latest/Next</a></li><li><a class="dropdown__link" href="/SpotifyAPI-NET/docs/home">5.1.1</a></li></ul></div><a class="navbar__item navbar__link" href="/SpotifyAPI-NET/news">News</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/JohnnyCrazy/SpotifyAPI-NET" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">GitHub</a><div class="react-toggle react-toggle--disabled displayOnlyInLargeViewport_1gtM"><div class="react-toggle-track"><div class="react-toggle-track-check"><span class="toggle_keGJ moon_1gwN"></span></div><div class="react-toggle-track-x"><span class="toggle_keGJ sun_3CPA"></span></div></div><div class="react-toggle-thumb"></div><input type="checkbox" disabled="" aria-label="Dark mode toggle" class="react-toggle-screenreader-only"></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div><div class="navbar-sidebar"><div class="navbar-sidebar__brand"><a class="navbar__brand" href="/SpotifyAPI-NET/"><img class="navbar__logo" src="/SpotifyAPI-NET/img/logo.svg" alt="SpotifyAPI-NET"><strong class="navbar__title">SpotifyAPI-NET</strong></a></div><div class="navbar-sidebar__items"><div class="menu"><ul class="menu__list"><li class="menu__list-item"><a activeclassname="navbar__link--active" class="menu__link menu__link--sublist">Docs</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" href="/SpotifyAPI-NET/docs/next/introduction">Latest/Next</a></li><li class="menu__list-item"><a class="menu__link" href="/SpotifyAPI-NET/docs/home">5.1.1</a></li></ul></li><li class="menu__list-item"><a class="menu__link" href="/SpotifyAPI-NET/news">News</a></li><li class="menu__list-item"><a href="https://github.com/JohnnyCrazy/SpotifyAPI-NET" target="_blank" rel="noopener noreferrer" class="menu__link">GitHub</a></li></ul></div></div></div></nav><div class="main-wrapper"><div class="container margin-vert--xl"><div class="row"><div class="col col--6 col--offset-3"><h1 class="hero__title">Page Not Found</h1><p>We could not find what you were looking for.</p><p>Please contact the owner of the site that linked you to the original URL and let them know their link is broken.</p></div></div></div></div><footer class="footer footer--dark"><div class="container"><div class="text--center"><div>Copyright © 2021 Jonas Dellinger. Built with Docusaurus.</div></div></div></footer></div>
|
<nav class="navbar navbar--light navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><div aria-label="Navigation bar toggle" class="navbar__toggle" role="button" tabindex="0"><svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 30 30" role="img" focusable="false"><title>Menu</title><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></div><a class="navbar__brand" href="/SpotifyAPI-NET/"><img class="navbar__logo" src="/SpotifyAPI-NET/img/logo.svg" alt="SpotifyAPI-NET"><strong class="navbar__title">SpotifyAPI-NET</strong></a><div class="navbar__item dropdown dropdown--hoverable dropdown--left"><a activeclassname="navbar__link--active" class="navbar__item navbar__link">Docs</a><ul class="dropdown__menu"><li><a class="dropdown__link" href="/SpotifyAPI-NET/docs/next/introduction">Latest/Next</a></li><li><a class="dropdown__link" href="/SpotifyAPI-NET/docs/home">5.1.1</a></li></ul></div><a class="navbar__item navbar__link" href="/SpotifyAPI-NET/news">News</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/JohnnyCrazy/SpotifyAPI-NET" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">GitHub</a><div class="react-toggle react-toggle--disabled displayOnlyInLargeViewport_1gtM"><div class="react-toggle-track"><div class="react-toggle-track-check"><span class="toggle_keGJ moon_1gwN"></span></div><div class="react-toggle-track-x"><span class="toggle_keGJ sun_3CPA"></span></div></div><div class="react-toggle-thumb"></div><input type="checkbox" disabled="" aria-label="Dark mode toggle" class="react-toggle-screenreader-only"></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div><div class="navbar-sidebar"><div class="navbar-sidebar__brand"><a class="navbar__brand" href="/SpotifyAPI-NET/"><img class="navbar__logo" src="/SpotifyAPI-NET/img/logo.svg" alt="SpotifyAPI-NET"><strong class="navbar__title">SpotifyAPI-NET</strong></a></div><div class="navbar-sidebar__items"><div class="menu"><ul class="menu__list"><li class="menu__list-item"><a activeclassname="navbar__link--active" class="menu__link menu__link--sublist">Docs</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" href="/SpotifyAPI-NET/docs/next/introduction">Latest/Next</a></li><li class="menu__list-item"><a class="menu__link" href="/SpotifyAPI-NET/docs/home">5.1.1</a></li></ul></li><li class="menu__list-item"><a class="menu__link" href="/SpotifyAPI-NET/news">News</a></li><li class="menu__list-item"><a href="https://github.com/JohnnyCrazy/SpotifyAPI-NET" target="_blank" rel="noopener noreferrer" class="menu__link">GitHub</a></li></ul></div></div></div></nav><div class="main-wrapper"><div class="container margin-vert--xl"><div class="row"><div class="col col--6 col--offset-3"><h1 class="hero__title">Page Not Found</h1><p>We could not find what you were looking for.</p><p>Please contact the owner of the site that linked you to the original URL and let them know their link is broken.</p></div></div></div></div><footer class="footer footer--dark"><div class="container"><div class="text--center"><div>Copyright © 2021 Jonas Dellinger. Built with Docusaurus.</div></div></div></footer></div>
|
||||||
<script src="/SpotifyAPI-NET/styles.20e5fb07.js"></script>
|
<script src="/SpotifyAPI-NET/styles.20e5fb07.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/runtime~main.df71fe3f.js"></script>
|
<script src="/SpotifyAPI-NET/runtime~main.059d8efb.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/main.b4c50bf9.js"></script>
|
<script src="/SpotifyAPI-NET/main.b4c50bf9.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
|||||||
(window.webpackJsonp=window.webpackJsonp||[]).push([[29],{161:function(e,t,r){"use strict";r.r(t),r.d(t,"frontMatter",(function(){return c})),r.d(t,"metadata",(function(){return i})),r.d(t,"rightToc",(function(){return p})),r.d(t,"default",(function(){return l}));var n=r(2),o=r(9),a=(r(0),r(188)),c={id:"example_uwp",title:"UWP"},i={id:"example_uwp",title:"UWP",source:"@site/docs/example_uwp.md",permalink:"/SpotifyAPI-NET/docs/next/example_uwp",editUrl:"https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/docs/example_uwp.md",version:"next",lastUpdatedBy:"Jonas Dellinger",lastUpdatedAt:1614683995,sidebar:"docs",previous:{title:"Token Swap",permalink:"/SpotifyAPI-NET/docs/next/example_token_swap"},next:{title:"5.x.x to 6.x.x",permalink:"/SpotifyAPI-NET/docs/next/5_to_6"}},p=[],u={rightToc:p};function l(e){var t=e.components,r=Object(o.a)(e,["components"]);return Object(a.b)("wrapper",Object(n.a)({},u,r,{components:t,mdxType:"MDXLayout"}))}l.isMDXComponent=!0},188:function(e,t,r){"use strict";r.d(t,"a",(function(){return f})),r.d(t,"b",(function(){return d}));var n=r(0),o=r.n(n);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function p(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=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])}return o}var u=o.a.createContext({}),l=function(e){var t=o.a.useContext(u),r=t;return e&&(r="function"==typeof e?e(t):i({},t,{},e)),r},f=function(e){var t=l(e.components);return o.a.createElement(u.Provider,{value:t},e.children)},s={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},m=Object(n.forwardRef)((function(e,t){var r=e.components,n=e.mdxType,a=e.originalType,c=e.parentName,u=p(e,["components","mdxType","originalType","parentName"]),f=l(r),m=n,d=f["".concat(c,".").concat(m)]||f[m]||s[m]||a;return r?o.a.createElement(d,i({ref:t},u,{components:r})):o.a.createElement(d,i({ref:t},u))}));function d(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var a=r.length,c=new Array(a);c[0]=m;var i={};for(var p in t)hasOwnProperty.call(t,p)&&(i[p]=t[p]);i.originalType=e,i.mdxType="string"==typeof e?e:n,c[1]=i;for(var u=2;u<a;u++)c[u]=r[u];return o.a.createElement.apply(null,c)}return o.a.createElement.apply(null,r)}m.displayName="MDXCreateElement"}}]);
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[29],{161:function(e,t,r){"use strict";r.r(t),r.d(t,"frontMatter",(function(){return c})),r.d(t,"metadata",(function(){return i})),r.d(t,"rightToc",(function(){return p})),r.d(t,"default",(function(){return l}));var n=r(2),o=r(9),a=(r(0),r(188)),c={id:"example_uwp",title:"UWP"},i={id:"example_uwp",title:"UWP",source:"@site/docs/example_uwp.md",permalink:"/SpotifyAPI-NET/docs/next/example_uwp",editUrl:"https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/docs/example_uwp.md",version:"next",lastUpdatedBy:"Jonas Dellinger",lastUpdatedAt:1614760606,sidebar:"docs",previous:{title:"Token Swap",permalink:"/SpotifyAPI-NET/docs/next/example_token_swap"},next:{title:"5.x.x to 6.x.x",permalink:"/SpotifyAPI-NET/docs/next/5_to_6"}},p=[],u={rightToc:p};function l(e){var t=e.components,r=Object(o.a)(e,["components"]);return Object(a.b)("wrapper",Object(n.a)({},u,r,{components:t,mdxType:"MDXLayout"}))}l.isMDXComponent=!0},188:function(e,t,r){"use strict";r.d(t,"a",(function(){return f})),r.d(t,"b",(function(){return d}));var n=r(0),o=r.n(n);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function p(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=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])}return o}var u=o.a.createContext({}),l=function(e){var t=o.a.useContext(u),r=t;return e&&(r="function"==typeof e?e(t):i({},t,{},e)),r},f=function(e){var t=l(e.components);return o.a.createElement(u.Provider,{value:t},e.children)},s={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},m=Object(n.forwardRef)((function(e,t){var r=e.components,n=e.mdxType,a=e.originalType,c=e.parentName,u=p(e,["components","mdxType","originalType","parentName"]),f=l(r),m=n,d=f["".concat(c,".").concat(m)]||f[m]||s[m]||a;return r?o.a.createElement(d,i({ref:t},u,{components:r})):o.a.createElement(d,i({ref:t},u))}));function d(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var a=r.length,c=new Array(a);c[0]=m;var i={};for(var p in t)hasOwnProperty.call(t,p)&&(i[p]=t[p]);i.originalType=e,i.mdxType="string"==typeof e?e:n,c[1]=i;for(var u=2;u<a;u++)c[u]=r[u];return o.a.createElement.apply(null,c)}return o.a.createElement.apply(null,r)}m.displayName="MDXCreateElement"}}]);
|
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
|||||||
(window.webpackJsonp=window.webpackJsonp||[]).push([[31],{163:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return i})),n.d(t,"metadata",(function(){return c})),n.d(t,"rightToc",(function(){return l})),n.d(t,"default",(function(){return u}));var r=n(2),o=n(9),a=(n(0),n(188)),i={id:"client_credentials",title:"Client Credentials"},c={id:"version-5.1.1/auth/client_credentials",title:"Client Credentials",description:"With this approach, you make a POST Request with a base64 encoded string (consists of ClientId + ClientSecret). You will directly get the token (Without a local HTTP Server), but it will expire and can't be refreshed.",source:"@site/versioned_docs/version-5.1.1/auth/client_credentials.md",permalink:"/SpotifyAPI-NET/docs/auth/client_credentials",editUrl:"https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/versioned_docs/version-5.1.1/auth/client_credentials.md",version:"5.1.1",lastUpdatedBy:"Jonas Dellinger",lastUpdatedAt:1614683995,sidebar:"version-5.1.1/someSidebar",previous:{title:"Authorization Code",permalink:"/SpotifyAPI-NET/docs/auth/authorization_code"},next:{title:"Token Swap",permalink:"/SpotifyAPI-NET/docs/auth/token_swap"}},l=[],s={rightToc:l};function u(e){var t=e.components,n=Object(o.a)(e,["components"]);return Object(a.b)("wrapper",Object(r.a)({},s,n,{components:t,mdxType:"MDXLayout"}),Object(a.b)("p",null,"With this approach, you make a POST Request with a base64 encoded string (consists of ClientId + ClientSecret). You will directly get the token (Without a local HTTP Server), but it will expire and can't be refreshed.\nIf you want to use it securely, you would need to do it all server-side.\n",Object(a.b)("strong",{parentName:"p"},"NOTE:")," You will only be able to query non-user-related information e.g search for a Track."),Object(a.b)("p",null,"More info: ",Object(a.b)("a",Object(r.a)({parentName:"p"},{href:"https://developer.spotify.com/documentation/general/guides/authorization-guide/#client-credentials-flow"}),"here")),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-csharp"}),"CredentialsAuth auth = new CredentialsAuth(_clientId, _secretId);\nToken token = await auth.GetToken();\nSpotifyWebAPI api = new SpotifyWebAPI()\n{\n TokenType = token.TokenType,\n AccessToken = token.AccessToken\n};\n")))}u.isMDXComponent=!0},188:function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return b}));var r=n(0),o=n.n(r);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=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])}return o}var s=o.a.createContext({}),u=function(e){var t=o.a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):c({},t,{},e)),n},p=function(e){var t=u(e.components);return o.a.createElement(s.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},f=Object(r.forwardRef)((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,i=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),p=u(n),f=r,b=p["".concat(i,".").concat(f)]||p[f]||d[f]||a;return n?o.a.createElement(b,c({ref:t},s,{components:n})):o.a.createElement(b,c({ref:t},s))}));function b(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,i=new Array(a);i[0]=f;var c={};for(var l in t)hasOwnProperty.call(t,l)&&(c[l]=t[l]);c.originalType=e,c.mdxType="string"==typeof e?e:r,i[1]=c;for(var s=2;s<a;s++)i[s]=n[s];return o.a.createElement.apply(null,i)}return o.a.createElement.apply(null,n)}f.displayName="MDXCreateElement"}}]);
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[31],{163:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return i})),n.d(t,"metadata",(function(){return c})),n.d(t,"rightToc",(function(){return l})),n.d(t,"default",(function(){return u}));var r=n(2),o=n(9),a=(n(0),n(188)),i={id:"client_credentials",title:"Client Credentials"},c={id:"version-5.1.1/auth/client_credentials",title:"Client Credentials",description:"With this approach, you make a POST Request with a base64 encoded string (consists of ClientId + ClientSecret). You will directly get the token (Without a local HTTP Server), but it will expire and can't be refreshed.",source:"@site/versioned_docs/version-5.1.1/auth/client_credentials.md",permalink:"/SpotifyAPI-NET/docs/auth/client_credentials",editUrl:"https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/versioned_docs/version-5.1.1/auth/client_credentials.md",version:"5.1.1",lastUpdatedBy:"Jonas Dellinger",lastUpdatedAt:1614760606,sidebar:"version-5.1.1/someSidebar",previous:{title:"Authorization Code",permalink:"/SpotifyAPI-NET/docs/auth/authorization_code"},next:{title:"Token Swap",permalink:"/SpotifyAPI-NET/docs/auth/token_swap"}},l=[],s={rightToc:l};function u(e){var t=e.components,n=Object(o.a)(e,["components"]);return Object(a.b)("wrapper",Object(r.a)({},s,n,{components:t,mdxType:"MDXLayout"}),Object(a.b)("p",null,"With this approach, you make a POST Request with a base64 encoded string (consists of ClientId + ClientSecret). You will directly get the token (Without a local HTTP Server), but it will expire and can't be refreshed.\nIf you want to use it securely, you would need to do it all server-side.\n",Object(a.b)("strong",{parentName:"p"},"NOTE:")," You will only be able to query non-user-related information e.g search for a Track."),Object(a.b)("p",null,"More info: ",Object(a.b)("a",Object(r.a)({parentName:"p"},{href:"https://developer.spotify.com/documentation/general/guides/authorization-guide/#client-credentials-flow"}),"here")),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-csharp"}),"CredentialsAuth auth = new CredentialsAuth(_clientId, _secretId);\nToken token = await auth.GetToken();\nSpotifyWebAPI api = new SpotifyWebAPI()\n{\n TokenType = token.TokenType,\n AccessToken = token.AccessToken\n};\n")))}u.isMDXComponent=!0},188:function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return b}));var r=n(0),o=n.n(r);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=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])}return o}var s=o.a.createContext({}),u=function(e){var t=o.a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):c({},t,{},e)),n},p=function(e){var t=u(e.components);return o.a.createElement(s.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},f=Object(r.forwardRef)((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,i=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),p=u(n),f=r,b=p["".concat(i,".").concat(f)]||p[f]||d[f]||a;return n?o.a.createElement(b,c({ref:t},s,{components:n})):o.a.createElement(b,c({ref:t},s))}));function b(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,i=new Array(a);i[0]=f;var c={};for(var l in t)hasOwnProperty.call(t,l)&&(c[l]=t[l]);c.originalType=e,c.mdxType="string"==typeof e?e:r,i[1]=c;for(var s=2;s<a;s++)i[s]=n[s];return o.a.createElement.apply(null,i)}return o.a.createElement.apply(null,n)}f.displayName="MDXCreateElement"}}]);
|
@ -1 +1 @@
|
|||||||
(window.webpackJsonp=window.webpackJsonp||[]).push([[32],{164:function(e,t,r){"use strict";r.r(t),r.d(t,"frontMatter",(function(){return a})),r.d(t,"metadata",(function(){return c})),r.d(t,"rightToc",(function(){return p})),r.d(t,"default",(function(){return s}));var n=r(2),o=r(9),i=(r(0),r(188)),a={id:"proxy",title:"Proxy Settings",sidebar_label:"Proxy Settings"},c={id:"version-5.1.1/web/proxy",title:"Proxy Settings",description:"You can forward your proxy settings to the web api by using a field in the SpotifyLocalAPIConfig.",source:"@site/versioned_docs/version-5.1.1/web/proxy.md",permalink:"/SpotifyAPI-NET/docs/web/proxy",editUrl:"https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/versioned_docs/version-5.1.1/web/proxy.md",version:"5.1.1",lastUpdatedBy:"Jonas Dellinger",lastUpdatedAt:1614683995,sidebar_label:"Proxy Settings",sidebar:"version-5.1.1/someSidebar",previous:{title:"Profiles",permalink:"/SpotifyAPI-NET/docs/web/profiles"},next:{title:"Search",permalink:"/SpotifyAPI-NET/docs/web/search"}},p=[],l={rightToc:p};function s(e){var t=e.components,r=Object(o.a)(e,["components"]);return Object(i.b)("wrapper",Object(n.a)({},l,r,{components:t,mdxType:"MDXLayout"}),Object(i.b)("p",null,"You can forward your proxy settings to the web api by using a field in the ",Object(i.b)("inlineCode",{parentName:"p"},"SpotifyLocalAPIConfig"),"."),Object(i.b)("pre",null,Object(i.b)("code",Object(n.a)({parentName:"pre"},{className:"language-csharp"}),'ProxyConfig proxyConfig = new ProxyConfig()\n{\n Host = "127.0.0.1",\n Port = 8080\n // Additional values like Username and Password are available\n};\n\nSpotifyWebAPI api = new SpotifyWebAPI(proxyConfig);\n')))}s.isMDXComponent=!0},188:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return b}));var n=r(0),o=r.n(n);function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){i(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))}))}return e}function p(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var l=o.a.createContext({}),s=function(e){var t=o.a.useContext(l),r=t;return e&&(r="function"==typeof e?e(t):c({},t,{},e)),r},u=function(e){var t=s(e.components);return o.a.createElement(l.Provider,{value:t},e.children)},f={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},y=Object(n.forwardRef)((function(e,t){var r=e.components,n=e.mdxType,i=e.originalType,a=e.parentName,l=p(e,["components","mdxType","originalType","parentName"]),u=s(r),y=n,b=u["".concat(a,".").concat(y)]||u[y]||f[y]||i;return r?o.a.createElement(b,c({ref:t},l,{components:r})):o.a.createElement(b,c({ref:t},l))}));function b(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var i=r.length,a=new Array(i);a[0]=y;var c={};for(var p in t)hasOwnProperty.call(t,p)&&(c[p]=t[p]);c.originalType=e,c.mdxType="string"==typeof e?e:n,a[1]=c;for(var l=2;l<i;l++)a[l]=r[l];return o.a.createElement.apply(null,a)}return o.a.createElement.apply(null,r)}y.displayName="MDXCreateElement"}}]);
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[32],{164:function(e,t,r){"use strict";r.r(t),r.d(t,"frontMatter",(function(){return a})),r.d(t,"metadata",(function(){return c})),r.d(t,"rightToc",(function(){return p})),r.d(t,"default",(function(){return s}));var n=r(2),o=r(9),i=(r(0),r(188)),a={id:"proxy",title:"Proxy Settings",sidebar_label:"Proxy Settings"},c={id:"version-5.1.1/web/proxy",title:"Proxy Settings",description:"You can forward your proxy settings to the web api by using a field in the SpotifyLocalAPIConfig.",source:"@site/versioned_docs/version-5.1.1/web/proxy.md",permalink:"/SpotifyAPI-NET/docs/web/proxy",editUrl:"https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/versioned_docs/version-5.1.1/web/proxy.md",version:"5.1.1",lastUpdatedBy:"Jonas Dellinger",lastUpdatedAt:1614760606,sidebar_label:"Proxy Settings",sidebar:"version-5.1.1/someSidebar",previous:{title:"Profiles",permalink:"/SpotifyAPI-NET/docs/web/profiles"},next:{title:"Search",permalink:"/SpotifyAPI-NET/docs/web/search"}},p=[],l={rightToc:p};function s(e){var t=e.components,r=Object(o.a)(e,["components"]);return Object(i.b)("wrapper",Object(n.a)({},l,r,{components:t,mdxType:"MDXLayout"}),Object(i.b)("p",null,"You can forward your proxy settings to the web api by using a field in the ",Object(i.b)("inlineCode",{parentName:"p"},"SpotifyLocalAPIConfig"),"."),Object(i.b)("pre",null,Object(i.b)("code",Object(n.a)({parentName:"pre"},{className:"language-csharp"}),'ProxyConfig proxyConfig = new ProxyConfig()\n{\n Host = "127.0.0.1",\n Port = 8080\n // Additional values like Username and Password are available\n};\n\nSpotifyWebAPI api = new SpotifyWebAPI(proxyConfig);\n')))}s.isMDXComponent=!0},188:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return b}));var n=r(0),o=r.n(n);function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){i(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))}))}return e}function p(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var l=o.a.createContext({}),s=function(e){var t=o.a.useContext(l),r=t;return e&&(r="function"==typeof e?e(t):c({},t,{},e)),r},u=function(e){var t=s(e.components);return o.a.createElement(l.Provider,{value:t},e.children)},f={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},y=Object(n.forwardRef)((function(e,t){var r=e.components,n=e.mdxType,i=e.originalType,a=e.parentName,l=p(e,["components","mdxType","originalType","parentName"]),u=s(r),y=n,b=u["".concat(a,".").concat(y)]||u[y]||f[y]||i;return r?o.a.createElement(b,c({ref:t},l,{components:r})):o.a.createElement(b,c({ref:t},l))}));function b(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var i=r.length,a=new Array(i);a[0]=y;var c={};for(var p in t)hasOwnProperty.call(t,p)&&(c[p]=t[p]);c.originalType=e,c.mdxType="string"==typeof e?e:n,a[1]=c;for(var l=2;l<i;l++)a[l]=r[l];return o.a.createElement.apply(null,a)}return o.a.createElement.apply(null,r)}y.displayName="MDXCreateElement"}}]);
|
@ -1 +1 @@
|
|||||||
(window.webpackJsonp=window.webpackJsonp||[]).push([[33],{165:function(e,t,r){"use strict";r.r(t),r.d(t,"frontMatter",(function(){return a})),r.d(t,"metadata",(function(){return i})),r.d(t,"rightToc",(function(){return l})),r.d(t,"default",(function(){return u}));var n=r(2),o=r(9),c=(r(0),r(188)),a={id:"example_cli_custom_html",title:"CLI - Custom HTML"},i={id:"example_cli_custom_html",title:"CLI - Custom HTML",source:"@site/docs/example_cli_custom_html.md",permalink:"/SpotifyAPI-NET/docs/next/example_cli_custom_html",editUrl:"https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/docs/example_cli_custom_html.md",version:"next",lastUpdatedBy:"Jonas Dellinger",lastUpdatedAt:1614683995,sidebar:"docs",previous:{title:"Blazor ServerSide",permalink:"/SpotifyAPI-NET/docs/next/example_blazor"},next:{title:"CLI - Persistent Config",permalink:"/SpotifyAPI-NET/docs/next/example_cli_persistent_config"}},l=[],p={rightToc:l};function u(e){var t=e.components,r=Object(o.a)(e,["components"]);return Object(c.b)("wrapper",Object(n.a)({},p,r,{components:t,mdxType:"MDXLayout"}))}u.isMDXComponent=!0},188:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return d}));var n=r(0),o=r.n(n);function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){c(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))}))}return e}function l(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},c=Object.keys(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var p=o.a.createContext({}),u=function(e){var t=o.a.useContext(p),r=t;return e&&(r="function"==typeof e?e(t):i({},t,{},e)),r},s=function(e){var t=u(e.components);return o.a.createElement(p.Provider,{value:t},e.children)},f={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},m=Object(n.forwardRef)((function(e,t){var r=e.components,n=e.mdxType,c=e.originalType,a=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),s=u(r),m=n,d=s["".concat(a,".").concat(m)]||s[m]||f[m]||c;return r?o.a.createElement(d,i({ref:t},p,{components:r})):o.a.createElement(d,i({ref:t},p))}));function d(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var c=r.length,a=new Array(c);a[0]=m;var i={};for(var l in t)hasOwnProperty.call(t,l)&&(i[l]=t[l]);i.originalType=e,i.mdxType="string"==typeof e?e:n,a[1]=i;for(var p=2;p<c;p++)a[p]=r[p];return o.a.createElement.apply(null,a)}return o.a.createElement.apply(null,r)}m.displayName="MDXCreateElement"}}]);
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[33],{165:function(e,t,r){"use strict";r.r(t),r.d(t,"frontMatter",(function(){return a})),r.d(t,"metadata",(function(){return i})),r.d(t,"rightToc",(function(){return l})),r.d(t,"default",(function(){return u}));var n=r(2),o=r(9),c=(r(0),r(188)),a={id:"example_cli_custom_html",title:"CLI - Custom HTML"},i={id:"example_cli_custom_html",title:"CLI - Custom HTML",source:"@site/docs/example_cli_custom_html.md",permalink:"/SpotifyAPI-NET/docs/next/example_cli_custom_html",editUrl:"https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/docs/example_cli_custom_html.md",version:"next",lastUpdatedBy:"Jonas Dellinger",lastUpdatedAt:1614760606,sidebar:"docs",previous:{title:"Blazor ServerSide",permalink:"/SpotifyAPI-NET/docs/next/example_blazor"},next:{title:"CLI - Persistent Config",permalink:"/SpotifyAPI-NET/docs/next/example_cli_persistent_config"}},l=[],p={rightToc:l};function u(e){var t=e.components,r=Object(o.a)(e,["components"]);return Object(c.b)("wrapper",Object(n.a)({},p,r,{components:t,mdxType:"MDXLayout"}))}u.isMDXComponent=!0},188:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return d}));var n=r(0),o=r.n(n);function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){c(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))}))}return e}function l(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},c=Object.keys(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var p=o.a.createContext({}),u=function(e){var t=o.a.useContext(p),r=t;return e&&(r="function"==typeof e?e(t):i({},t,{},e)),r},s=function(e){var t=u(e.components);return o.a.createElement(p.Provider,{value:t},e.children)},f={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},m=Object(n.forwardRef)((function(e,t){var r=e.components,n=e.mdxType,c=e.originalType,a=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),s=u(r),m=n,d=s["".concat(a,".").concat(m)]||s[m]||f[m]||c;return r?o.a.createElement(d,i({ref:t},p,{components:r})):o.a.createElement(d,i({ref:t},p))}));function d(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var c=r.length,a=new Array(c);a[0]=m;var i={};for(var l in t)hasOwnProperty.call(t,l)&&(i[l]=t[l]);i.originalType=e,i.mdxType="string"==typeof e?e:n,a[1]=i;for(var p=2;p<c;p++)a[p]=r[p];return o.a.createElement.apply(null,a)}return o.a.createElement.apply(null,r)}m.displayName="MDXCreateElement"}}]);
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
|||||||
(window.webpackJsonp=window.webpackJsonp||[]).push([[40],{172:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return a})),n.d(t,"metadata",(function(){return c})),n.d(t,"rightToc",(function(){return s})),n.d(t,"default",(function(){return l}));var r=n(2),i=n(9),o=(n(0),n(188)),a={id:"unit_testing",title:"Unit Testing"},c={id:"unit_testing",title:"Unit Testing",description:"The modular structure of the library makes it easy to mock the API when unit testing. Consider the following method:",source:"@site/docs/unit_testing.md",permalink:"/SpotifyAPI-NET/docs/next/unit_testing",editUrl:"https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/docs/unit_testing.md",version:"next",lastUpdatedBy:"Jonas Dellinger",lastUpdatedAt:1614683995,sidebar:"docs",previous:{title:"IPlayableItem",permalink:"/SpotifyAPI-NET/docs/next/iplayableitem"},next:{title:"Introduction",permalink:"/SpotifyAPI-NET/docs/next/auth_introduction"}},s=[],u={rightToc:s};function l(e){var t=e.components,n=Object(i.a)(e,["components"]);return Object(o.b)("wrapper",Object(r.a)({},u,n,{components:t,mdxType:"MDXLayout"}),Object(o.b)("p",null,"The modular structure of the library makes it easy to mock the API when unit testing. Consider the following method:"),Object(o.b)("pre",null,Object(o.b)("code",Object(r.a)({parentName:"pre"},{className:"language-csharp"}),'public static async Task<bool> IsAdmin(IUserProfileClient userProfileClient)\n{\n // get logged in user\n var user = await userProfileClient.Current();\n\n // only my user id is an admin\n return user.Id == "1122095781";\n}\n')),Object(o.b)("p",null,"Using ",Object(o.b)("inlineCode",{parentName:"p"},"Moq"),", this can be tested without doing any network requests:"),Object(o.b)("pre",null,Object(o.b)("code",Object(r.a)({parentName:"pre"},{className:"language-csharp"}),'[Test]\npublic async Task IsAdmin_SuccessTest()\n{\n var userProfileClient = new Mock<IUserProfileClient>();\n userProfileClient.Setup(u => u.Current()).Returns(\n Task.FromResult(new PrivateUser\n {\n Id = "1122095781"\n })\n );\n\n Assert.AreEqual(true, await IsAdmin(userProfileClient.Object));\n}\n')))}l.isMDXComponent=!0},188:function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return b}));var r=n(0),i=n.n(r);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=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))}))}return e}function s(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var u=i.a.createContext({}),l=function(e){var t=i.a.useContext(u),n=t;return e&&(n="function"==typeof e?e(t):c({},t,{},e)),n},p=function(e){var t=l(e.components);return i.a.createElement(u.Provider,{value:t},e.children)},f={inlineCode:"code",wrapper:function(e){var t=e.children;return i.a.createElement(i.a.Fragment,{},t)}},d=Object(r.forwardRef)((function(e,t){var n=e.components,r=e.mdxType,o=e.originalType,a=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),p=l(n),d=r,b=p["".concat(a,".").concat(d)]||p[d]||f[d]||o;return n?i.a.createElement(b,c({ref:t},u,{components:n})):i.a.createElement(b,c({ref:t},u))}));function b(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=n.length,a=new Array(o);a[0]=d;var c={};for(var s in t)hasOwnProperty.call(t,s)&&(c[s]=t[s]);c.originalType=e,c.mdxType="string"==typeof e?e:r,a[1]=c;for(var u=2;u<o;u++)a[u]=n[u];return i.a.createElement.apply(null,a)}return i.a.createElement.apply(null,n)}d.displayName="MDXCreateElement"}}]);
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[40],{172:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return a})),n.d(t,"metadata",(function(){return c})),n.d(t,"rightToc",(function(){return s})),n.d(t,"default",(function(){return l}));var r=n(2),i=n(9),o=(n(0),n(188)),a={id:"unit_testing",title:"Unit Testing"},c={id:"unit_testing",title:"Unit Testing",description:"The modular structure of the library makes it easy to mock the API when unit testing. Consider the following method:",source:"@site/docs/unit_testing.md",permalink:"/SpotifyAPI-NET/docs/next/unit_testing",editUrl:"https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/docs/unit_testing.md",version:"next",lastUpdatedBy:"Jonas Dellinger",lastUpdatedAt:1614760606,sidebar:"docs",previous:{title:"IPlayableItem",permalink:"/SpotifyAPI-NET/docs/next/iplayableitem"},next:{title:"Introduction",permalink:"/SpotifyAPI-NET/docs/next/auth_introduction"}},s=[],u={rightToc:s};function l(e){var t=e.components,n=Object(i.a)(e,["components"]);return Object(o.b)("wrapper",Object(r.a)({},u,n,{components:t,mdxType:"MDXLayout"}),Object(o.b)("p",null,"The modular structure of the library makes it easy to mock the API when unit testing. Consider the following method:"),Object(o.b)("pre",null,Object(o.b)("code",Object(r.a)({parentName:"pre"},{className:"language-csharp"}),'public static async Task<bool> IsAdmin(IUserProfileClient userProfileClient)\n{\n // get logged in user\n var user = await userProfileClient.Current();\n\n // only my user id is an admin\n return user.Id == "1122095781";\n}\n')),Object(o.b)("p",null,"Using ",Object(o.b)("inlineCode",{parentName:"p"},"Moq"),", this can be tested without doing any network requests:"),Object(o.b)("pre",null,Object(o.b)("code",Object(r.a)({parentName:"pre"},{className:"language-csharp"}),'[Test]\npublic async Task IsAdmin_SuccessTest()\n{\n var userProfileClient = new Mock<IUserProfileClient>();\n userProfileClient.Setup(u => u.Current()).Returns(\n Task.FromResult(new PrivateUser\n {\n Id = "1122095781"\n })\n );\n\n Assert.AreEqual(true, await IsAdmin(userProfileClient.Object));\n}\n')))}l.isMDXComponent=!0},188:function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return b}));var r=n(0),i=n.n(r);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=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))}))}return e}function s(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var u=i.a.createContext({}),l=function(e){var t=i.a.useContext(u),n=t;return e&&(n="function"==typeof e?e(t):c({},t,{},e)),n},p=function(e){var t=l(e.components);return i.a.createElement(u.Provider,{value:t},e.children)},f={inlineCode:"code",wrapper:function(e){var t=e.children;return i.a.createElement(i.a.Fragment,{},t)}},d=Object(r.forwardRef)((function(e,t){var n=e.components,r=e.mdxType,o=e.originalType,a=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),p=l(n),d=r,b=p["".concat(a,".").concat(d)]||p[d]||f[d]||o;return n?i.a.createElement(b,c({ref:t},u,{components:n})):i.a.createElement(b,c({ref:t},u))}));function b(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=n.length,a=new Array(o);a[0]=d;var c={};for(var s in t)hasOwnProperty.call(t,s)&&(c[s]=t[s]);c.originalType=e,c.mdxType="string"==typeof e?e:r,a[1]=c;for(var u=2;u<o;u++)a[u]=n[u];return i.a.createElement.apply(null,a)}return i.a.createElement.apply(null,n)}d.displayName="MDXCreateElement"}}]);
|
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
|||||||
(window.webpackJsonp=window.webpackJsonp||[]).push([[43],{175:function(t,e,n){"use strict";n.r(e),n.d(e,"frontMatter",(function(){return c})),n.d(e,"metadata",(function(){return p})),n.d(e,"rightToc",(function(){return s})),n.d(e,"default",(function(){return l}));var r=n(2),o=n(9),i=(n(0),n(188)),a=n(190),c={id:"proxy",title:"Proxy"},p={id:"proxy",title:"Proxy",description:"The included HTTPClient has full proxy configuration support:",source:"@site/docs/proxy.md",permalink:"/SpotifyAPI-NET/docs/next/proxy",editUrl:"https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/docs/proxy.md",version:"next",lastUpdatedBy:"Jonas Dellinger",lastUpdatedAt:1614683995,sidebar:"docs",previous:{title:"Logging",permalink:"/SpotifyAPI-NET/docs/next/logging"},next:{title:"Pagination",permalink:"/SpotifyAPI-NET/docs/next/pagination"}},s=[],u={rightToc:s};function l(t){var e=t.components,n=Object(o.a)(t,["components"]);return Object(i.b)("wrapper",Object(r.a)({},u,n,{components:e,mdxType:"MDXLayout"}),Object(i.b)("p",null,"The included ",Object(i.b)("inlineCode",{parentName:"p"},"HTTPClient")," has full proxy configuration support:"),Object(i.b)("pre",null,Object(i.b)("code",Object(r.a)({parentName:"pre"},{className:"language-csharp"}),'var httpClient = new NetHttpClient(new ProxyConfig("localhost", 8080)\n{\n User = "",\n Password = "",\n SkipSSLCheck = false,\n});\nvar config = SpotifyClientConfig\n .CreateDefault()\n .WithHTTPClient(httpClient);\n\nvar spotify = new SpotifyClient(config);\n')),Object(i.b)("p",null,"As an example, ",Object(i.b)("a",Object(r.a)({parentName:"p"},{href:"https://mitmproxy.org/"}),"mitmproxy")," can be used to inspect the requests and responses:"),Object(i.b)("img",{alt:"mitmproxy",src:Object(a.a)("img/mitmproxy.png")}))}l.isMDXComponent=!0},188:function(t,e,n){"use strict";n.d(e,"a",(function(){return l})),n.d(e,"b",(function(){return d}));var r=n(0),o=n.n(r);function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function c(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(Object(n),!0).forEach((function(e){i(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function p(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}var s=o.a.createContext({}),u=function(t){var e=o.a.useContext(s),n=e;return t&&(n="function"==typeof t?t(e):c({},e,{},t)),n},l=function(t){var e=u(t.components);return o.a.createElement(s.Provider,{value:e},t.children)},f={inlineCode:"code",wrapper:function(t){var e=t.children;return o.a.createElement(o.a.Fragment,{},e)}},y=Object(r.forwardRef)((function(t,e){var n=t.components,r=t.mdxType,i=t.originalType,a=t.parentName,s=p(t,["components","mdxType","originalType","parentName"]),l=u(n),y=r,d=l["".concat(a,".").concat(y)]||l[y]||f[y]||i;return n?o.a.createElement(d,c({ref:e},s,{components:n})):o.a.createElement(d,c({ref:e},s))}));function d(t,e){var n=arguments,r=e&&e.mdxType;if("string"==typeof t||r){var i=n.length,a=new Array(i);a[0]=y;var c={};for(var p in e)hasOwnProperty.call(e,p)&&(c[p]=e[p]);c.originalType=t,c.mdxType="string"==typeof t?t:r,a[1]=c;for(var s=2;s<i;s++)a[s]=n[s];return o.a.createElement.apply(null,a)}return o.a.createElement.apply(null,n)}y.displayName="MDXCreateElement"},189:function(t,e,n){"use strict";var r=n(0),o=n(49);e.a=function(){return Object(r.useContext)(o.a)}},190:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));n(191);var r=n(189);function o(t){var e=(Object(r.a)().siteConfig||{}).baseUrl,n=void 0===e?"/":e;if(!t)return t;return/^(https?:|\/\/)/.test(t)?t:t.startsWith("/")?n+t.slice(1):n+t}},191:function(t,e,n){"use strict";var r=n(17),o=n(35),i=n(192),a="".startsWith;r(r.P+r.F*n(193)("startsWith"),"String",{startsWith:function(t){var e=i(this,t,"startsWith"),n=o(Math.min(arguments.length>1?arguments[1]:void 0,e.length)),r=String(t);return a?a.call(e,r,n):e.slice(n,n+r.length)===r}})},192:function(t,e,n){var r=n(69),o=n(23);t.exports=function(t,e,n){if(r(e))throw TypeError("String#"+n+" doesn't accept regex!");return String(o(t))}},193:function(t,e,n){var r=n(3)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[r]=!1,!"/./"[t](e)}catch(o){}}return!0}}}]);
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[43],{175:function(t,e,n){"use strict";n.r(e),n.d(e,"frontMatter",(function(){return c})),n.d(e,"metadata",(function(){return p})),n.d(e,"rightToc",(function(){return s})),n.d(e,"default",(function(){return l}));var r=n(2),o=n(9),i=(n(0),n(188)),a=n(190),c={id:"proxy",title:"Proxy"},p={id:"proxy",title:"Proxy",description:"The included HTTPClient has full proxy configuration support:",source:"@site/docs/proxy.md",permalink:"/SpotifyAPI-NET/docs/next/proxy",editUrl:"https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/docs/proxy.md",version:"next",lastUpdatedBy:"Jonas Dellinger",lastUpdatedAt:1614760606,sidebar:"docs",previous:{title:"Logging",permalink:"/SpotifyAPI-NET/docs/next/logging"},next:{title:"Pagination",permalink:"/SpotifyAPI-NET/docs/next/pagination"}},s=[],u={rightToc:s};function l(t){var e=t.components,n=Object(o.a)(t,["components"]);return Object(i.b)("wrapper",Object(r.a)({},u,n,{components:e,mdxType:"MDXLayout"}),Object(i.b)("p",null,"The included ",Object(i.b)("inlineCode",{parentName:"p"},"HTTPClient")," has full proxy configuration support:"),Object(i.b)("pre",null,Object(i.b)("code",Object(r.a)({parentName:"pre"},{className:"language-csharp"}),'var httpClient = new NetHttpClient(new ProxyConfig("localhost", 8080)\n{\n User = "",\n Password = "",\n SkipSSLCheck = false,\n});\nvar config = SpotifyClientConfig\n .CreateDefault()\n .WithHTTPClient(httpClient);\n\nvar spotify = new SpotifyClient(config);\n')),Object(i.b)("p",null,"As an example, ",Object(i.b)("a",Object(r.a)({parentName:"p"},{href:"https://mitmproxy.org/"}),"mitmproxy")," can be used to inspect the requests and responses:"),Object(i.b)("img",{alt:"mitmproxy",src:Object(a.a)("img/mitmproxy.png")}))}l.isMDXComponent=!0},188:function(t,e,n){"use strict";n.d(e,"a",(function(){return l})),n.d(e,"b",(function(){return d}));var r=n(0),o=n.n(r);function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function c(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(Object(n),!0).forEach((function(e){i(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function p(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}var s=o.a.createContext({}),u=function(t){var e=o.a.useContext(s),n=e;return t&&(n="function"==typeof t?t(e):c({},e,{},t)),n},l=function(t){var e=u(t.components);return o.a.createElement(s.Provider,{value:e},t.children)},f={inlineCode:"code",wrapper:function(t){var e=t.children;return o.a.createElement(o.a.Fragment,{},e)}},y=Object(r.forwardRef)((function(t,e){var n=t.components,r=t.mdxType,i=t.originalType,a=t.parentName,s=p(t,["components","mdxType","originalType","parentName"]),l=u(n),y=r,d=l["".concat(a,".").concat(y)]||l[y]||f[y]||i;return n?o.a.createElement(d,c({ref:e},s,{components:n})):o.a.createElement(d,c({ref:e},s))}));function d(t,e){var n=arguments,r=e&&e.mdxType;if("string"==typeof t||r){var i=n.length,a=new Array(i);a[0]=y;var c={};for(var p in e)hasOwnProperty.call(e,p)&&(c[p]=e[p]);c.originalType=t,c.mdxType="string"==typeof t?t:r,a[1]=c;for(var s=2;s<i;s++)a[s]=n[s];return o.a.createElement.apply(null,a)}return o.a.createElement.apply(null,n)}y.displayName="MDXCreateElement"},189:function(t,e,n){"use strict";var r=n(0),o=n(49);e.a=function(){return Object(r.useContext)(o.a)}},190:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));n(191);var r=n(189);function o(t){var e=(Object(r.a)().siteConfig||{}).baseUrl,n=void 0===e?"/":e;if(!t)return t;return/^(https?:|\/\/)/.test(t)?t:t.startsWith("/")?n+t.slice(1):n+t}},191:function(t,e,n){"use strict";var r=n(17),o=n(35),i=n(192),a="".startsWith;r(r.P+r.F*n(193)("startsWith"),"String",{startsWith:function(t){var e=i(this,t,"startsWith"),n=o(Math.min(arguments.length>1?arguments[1]:void 0,e.length)),r=String(t);return a?a.call(e,r,n):e.slice(n,n+r.length)===r}})},192:function(t,e,n){var r=n(69),o=n(23);t.exports=function(t,e,n){if(r(e))throw TypeError("String#"+n+" doesn't accept regex!");return String(o(t))}},193:function(t,e,n){var r=n(3)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[r]=!1,!"/./"[t](e)}catch(o){}}return!0}}}]);
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -6,14 +6,14 @@
|
|||||||
<meta name="generator" content="Docusaurus v2.0.0-alpha.56">
|
<meta name="generator" content="Docusaurus v2.0.0-alpha.56">
|
||||||
<title data-react-helmet="true">Authorization Code | SpotifyAPI-NET</title><meta data-react-helmet="true" name="docsearch:version" content="5.1.1"><meta data-react-helmet="true" name="twitter:card" content="summary_large_image"><meta data-react-helmet="true" property="og:title" content="Authorization Code | SpotifyAPI-NET"><meta data-react-helmet="true" name="description" content="This way is not recommended for client-side apps and requires server-side code to run securely."><meta data-react-helmet="true" property="og:description" content="This way is not recommended for client-side apps and requires server-side code to run securely."><meta data-react-helmet="true" property="og:url" content="https://johnnycrazy.github.io/SpotifyAPI-NET/docs/auth/authorization_code"><link data-react-helmet="true" rel="shortcut icon" href="/SpotifyAPI-NET/img/favicon.ico"><link data-react-helmet="true" rel="canonical" href="https://johnnycrazy.github.io/SpotifyAPI-NET/docs/auth/authorization_code"><link rel="stylesheet" href="/SpotifyAPI-NET/styles.8a053330.css">
|
<title data-react-helmet="true">Authorization Code | SpotifyAPI-NET</title><meta data-react-helmet="true" name="docsearch:version" content="5.1.1"><meta data-react-helmet="true" name="twitter:card" content="summary_large_image"><meta data-react-helmet="true" property="og:title" content="Authorization Code | SpotifyAPI-NET"><meta data-react-helmet="true" name="description" content="This way is not recommended for client-side apps and requires server-side code to run securely."><meta data-react-helmet="true" property="og:description" content="This way is not recommended for client-side apps and requires server-side code to run securely."><meta data-react-helmet="true" property="og:url" content="https://johnnycrazy.github.io/SpotifyAPI-NET/docs/auth/authorization_code"><link data-react-helmet="true" rel="shortcut icon" href="/SpotifyAPI-NET/img/favicon.ico"><link data-react-helmet="true" rel="canonical" href="https://johnnycrazy.github.io/SpotifyAPI-NET/docs/auth/authorization_code"><link rel="stylesheet" href="/SpotifyAPI-NET/styles.8a053330.css">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/styles.20e5fb07.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/styles.20e5fb07.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/runtime~main.df71fe3f.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/runtime~main.059d8efb.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/main.b4c50bf9.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/main.b4c50bf9.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/1.d763968b.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/1.d763968b.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/2.c001a4a7.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/2.c001a4a7.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/3.c31fd0fb.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/3.c31fd0fb.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/1be78505.6d7d8bd2.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/1be78505.6d7d8bd2.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/3d0d8a2f.44e5d4a3.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/3d0d8a2f.44e5d4a3.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/15560a88.87d09bef.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/15560a88.7b27c8fb.js" as="script">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=window.matchMedia("(prefers-color-scheme: dark)"),n=function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();null!==n?t(n):e.matches&&t("dark")}()</script><div id="__docusaurus">
|
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=window.matchMedia("(prefers-color-scheme: dark)"),n=function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();null!==n?t(n):e.matches&&t("dark")}()</script><div id="__docusaurus">
|
||||||
@ -23,15 +23,15 @@ In this exchange you need to provide your Client-Secret and because of that it&#
|
|||||||
A good thing about this method: You can always refresh your token, without having the user to auth it again.</p><p>More info: <a href="https://developer.spotify.com/documentation/general/guides/authorization-guide/#authorization-code-flow" target="_blank" rel="noopener noreferrer">here</a></p><div class="mdxCodeBlock_iHAB"><div class="codeBlockContent_32p_"><button type="button" aria-label="Copy code to clipboard" class="copyButton_1BYj">Copy</button><div tabindex="0" class="prism-code language-csharp codeBlock_19pQ"><div class="codeBlockLines_2n9r" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token plain">static async void Main(string[] args)</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">{</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> AuthorizationCodeAuth auth = new AuthorizationCodeAuth(</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> _clientId,</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> _secretId,</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> "http://localhost:4002",</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> "http://localhost:4002",</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> Scope.PlaylistReadPrivate | Scope.PlaylistReadCollaborative</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> );</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
|
A good thing about this method: You can always refresh your token, without having the user to auth it again.</p><p>More info: <a href="https://developer.spotify.com/documentation/general/guides/authorization-guide/#authorization-code-flow" target="_blank" rel="noopener noreferrer">here</a></p><div class="mdxCodeBlock_iHAB"><div class="codeBlockContent_32p_"><button type="button" aria-label="Copy code to clipboard" class="copyButton_1BYj">Copy</button><div tabindex="0" class="prism-code language-csharp codeBlock_19pQ"><div class="codeBlockLines_2n9r" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token plain">static async void Main(string[] args)</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">{</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> AuthorizationCodeAuth auth = new AuthorizationCodeAuth(</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> _clientId,</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> _secretId,</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> "http://localhost:4002",</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> "http://localhost:4002",</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> Scope.PlaylistReadPrivate | Scope.PlaylistReadCollaborative</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> );</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
|
||||||
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> auth.AuthReceived += async (sender, payload) =></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> {</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> auth.Stop();</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> Token token = await auth.ExchangeCode(payload.Code);</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> SpotifyWebAPI api = new SpotifyWebAPI()</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> {</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> TokenType = token.TokenType,</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> AccessToken = token.AccessToken</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> };</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> // Do requests with API client</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> };</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> auth.Start(); // Starts an internal HTTP Server</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> auth.OpenBrowser();</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">}</span></div></div></div></div></div><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_ZqCz" id="token-refresh"></a>Token Refresh<a aria-hidden="true" tabindex="-1" class="hash-link" href="#token-refresh" title="Direct link to heading">#</a></h2><p>Once the <code>AccessToken</code> is expired, you can use your <code>RefreshToken</code> to get a new one.
|
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> auth.AuthReceived += async (sender, payload) =></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> {</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> auth.Stop();</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> Token token = await auth.ExchangeCode(payload.Code);</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> SpotifyWebAPI api = new SpotifyWebAPI()</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> {</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> TokenType = token.TokenType,</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> AccessToken = token.AccessToken</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> };</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> // Do requests with API client</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> };</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> auth.Start(); // Starts an internal HTTP Server</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> auth.OpenBrowser();</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">}</span></div></div></div></div></div><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_ZqCz" id="token-refresh"></a>Token Refresh<a aria-hidden="true" tabindex="-1" class="hash-link" href="#token-refresh" title="Direct link to heading">#</a></h2><p>Once the <code>AccessToken</code> is expired, you can use your <code>RefreshToken</code> to get a new one.
|
||||||
In this procedure, no HTTP Server is needed in the background and a single HTTP Request is made.</p><div class="mdxCodeBlock_iHAB"><div class="codeBlockContent_32p_"><button type="button" aria-label="Copy code to clipboard" class="copyButton_1BYj">Copy</button><div tabindex="0" class="prism-code language-csharp codeBlock_19pQ"><div class="codeBlockLines_2n9r" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token plain">// Auth code from above</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
|
In this procedure, no HTTP Server is needed in the background and a single HTTP Request is made.</p><div class="mdxCodeBlock_iHAB"><div class="codeBlockContent_32p_"><button type="button" aria-label="Copy code to clipboard" class="copyButton_1BYj">Copy</button><div tabindex="0" class="prism-code language-csharp codeBlock_19pQ"><div class="codeBlockLines_2n9r" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token plain">// Auth code from above</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
|
||||||
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">if(token.IsExpired())</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">{</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> Token newToken = await auth.RefreshToken(token.RefreshToken);</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> api.AccessToken = newToken.AccessToken</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> api.TokenType = newToken.TokenType</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">}</span></div></div></div></div></div></div></article><div class="margin-vert--xl"><div class="row"><div class="col"><a href="https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/versioned_docs/version-5.1.1/auth/authorization_code.md" target="_blank" rel="noreferrer noopener"><svg fill="currentColor" height="1.2em" width="1.2em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 40 40" style="margin-right:0.3em;vertical-align:sub"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col text--right"><em><small>Last updated on <time datetime="2021-03-02T11:19:55.000Z" class="docLastUpdatedAt_1sqk">3/2/2021</time> by <strong>Jonas Dellinger</strong></small></em></div></div></div><div class="margin-vert--lg"><nav class="pagination-nav"><div class="pagination-nav__item"><a class="pagination-nav__link" href="/SpotifyAPI-NET/docs/auth/implicit_grant"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">« Implicit Grant</div></a></div><div class="pagination-nav__item pagination-nav__item--next"><a class="pagination-nav__link" href="/SpotifyAPI-NET/docs/auth/client_credentials"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Client Credentials »</div></a></div></nav></div></div></div><div class="col col--3"><div class="tableOfContents_TbNY"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#token-refresh" class="table-of-contents__link">Token Refresh</a></li></ul></div></div></div></div></main></div></div><footer class="footer footer--dark"><div class="container"><div class="text--center"><div>Copyright © 2021 Jonas Dellinger. Built with Docusaurus.</div></div></div></footer></div>
|
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">if(token.IsExpired())</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">{</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> Token newToken = await auth.RefreshToken(token.RefreshToken);</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> api.AccessToken = newToken.AccessToken</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> api.TokenType = newToken.TokenType</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">}</span></div></div></div></div></div></div></article><div class="margin-vert--xl"><div class="row"><div class="col"><a href="https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/versioned_docs/version-5.1.1/auth/authorization_code.md" target="_blank" rel="noreferrer noopener"><svg fill="currentColor" height="1.2em" width="1.2em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 40 40" style="margin-right:0.3em;vertical-align:sub"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col text--right"><em><small>Last updated on <time datetime="2021-03-03T08:36:46.000Z" class="docLastUpdatedAt_1sqk">3/3/2021</time> by <strong>Jonas Dellinger</strong></small></em></div></div></div><div class="margin-vert--lg"><nav class="pagination-nav"><div class="pagination-nav__item"><a class="pagination-nav__link" href="/SpotifyAPI-NET/docs/auth/implicit_grant"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">« Implicit Grant</div></a></div><div class="pagination-nav__item pagination-nav__item--next"><a class="pagination-nav__link" href="/SpotifyAPI-NET/docs/auth/client_credentials"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Client Credentials »</div></a></div></nav></div></div></div><div class="col col--3"><div class="tableOfContents_TbNY"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#token-refresh" class="table-of-contents__link">Token Refresh</a></li></ul></div></div></div></div></main></div></div><footer class="footer footer--dark"><div class="container"><div class="text--center"><div>Copyright © 2021 Jonas Dellinger. Built with Docusaurus.</div></div></div></footer></div>
|
||||||
<script src="/SpotifyAPI-NET/styles.20e5fb07.js"></script>
|
<script src="/SpotifyAPI-NET/styles.20e5fb07.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/runtime~main.df71fe3f.js"></script>
|
<script src="/SpotifyAPI-NET/runtime~main.059d8efb.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/main.b4c50bf9.js"></script>
|
<script src="/SpotifyAPI-NET/main.b4c50bf9.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/1.d763968b.js"></script>
|
<script src="/SpotifyAPI-NET/1.d763968b.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/2.c001a4a7.js"></script>
|
<script src="/SpotifyAPI-NET/2.c001a4a7.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/3.c31fd0fb.js"></script>
|
<script src="/SpotifyAPI-NET/3.c31fd0fb.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/1be78505.6d7d8bd2.js"></script>
|
<script src="/SpotifyAPI-NET/1be78505.6d7d8bd2.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/3d0d8a2f.44e5d4a3.js"></script>
|
<script src="/SpotifyAPI-NET/3d0d8a2f.44e5d4a3.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/15560a88.87d09bef.js"></script>
|
<script src="/SpotifyAPI-NET/15560a88.7b27c8fb.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -6,14 +6,14 @@
|
|||||||
<meta name="generator" content="Docusaurus v2.0.0-alpha.56">
|
<meta name="generator" content="Docusaurus v2.0.0-alpha.56">
|
||||||
<title data-react-helmet="true">5.x.x to 6.x.x | SpotifyAPI-NET</title><meta data-react-helmet="true" name="docsearch:version" content="next"><meta data-react-helmet="true" name="twitter:card" content="summary_large_image"><meta data-react-helmet="true" property="og:title" content="5.x.x to 6.x.x | SpotifyAPI-NET"><meta data-react-helmet="true" name="description" content="SpotifyAPI.Web"><meta data-react-helmet="true" property="og:description" content="SpotifyAPI.Web"><meta data-react-helmet="true" property="og:url" content="https://johnnycrazy.github.io/SpotifyAPI-NET/docs/next/5_to_6"><link data-react-helmet="true" rel="shortcut icon" href="/SpotifyAPI-NET/img/favicon.ico"><link data-react-helmet="true" rel="canonical" href="https://johnnycrazy.github.io/SpotifyAPI-NET/docs/next/5_to_6"><link rel="stylesheet" href="/SpotifyAPI-NET/styles.8a053330.css">
|
<title data-react-helmet="true">5.x.x to 6.x.x | SpotifyAPI-NET</title><meta data-react-helmet="true" name="docsearch:version" content="next"><meta data-react-helmet="true" name="twitter:card" content="summary_large_image"><meta data-react-helmet="true" property="og:title" content="5.x.x to 6.x.x | SpotifyAPI-NET"><meta data-react-helmet="true" name="description" content="SpotifyAPI.Web"><meta data-react-helmet="true" property="og:description" content="SpotifyAPI.Web"><meta data-react-helmet="true" property="og:url" content="https://johnnycrazy.github.io/SpotifyAPI-NET/docs/next/5_to_6"><link data-react-helmet="true" rel="shortcut icon" href="/SpotifyAPI-NET/img/favicon.ico"><link data-react-helmet="true" rel="canonical" href="https://johnnycrazy.github.io/SpotifyAPI-NET/docs/next/5_to_6"><link rel="stylesheet" href="/SpotifyAPI-NET/styles.8a053330.css">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/styles.20e5fb07.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/styles.20e5fb07.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/runtime~main.df71fe3f.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/runtime~main.059d8efb.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/main.b4c50bf9.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/main.b4c50bf9.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/1.d763968b.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/1.d763968b.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/2.c001a4a7.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/2.c001a4a7.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/3.c31fd0fb.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/3.c31fd0fb.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/1be78505.6d7d8bd2.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/1be78505.6d7d8bd2.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/ad407b76.90023bdf.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/ad407b76.90023bdf.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/16b2da92.d2778896.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/16b2da92.0cd8969f.js" as="script">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=window.matchMedia("(prefers-color-scheme: dark)"),n=function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();null!==n?t(n):e.matches&&t("dark")}()</script><div id="__docusaurus">
|
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=window.matchMedia("(prefers-color-scheme: dark)"),n=function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();null!==n?t(n):e.matches&&t("dark")}()</script><div id="__docusaurus">
|
||||||
@ -28,15 +28,15 @@
|
|||||||
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> Token token = await auth.ExchangeCode(payload.Code);</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> var spotify = new SpotifyWebAPI { AccessToken = token.AccessToken };</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> await PrintUsefulData(spotify);</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">}</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
|
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> Token token = await auth.ExchangeCode(payload.Code);</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> var spotify = new SpotifyWebAPI { AccessToken = token.AccessToken };</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> await PrintUsefulData(spotify);</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">}</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
|
||||||
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">// NEW</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">var config = SpotifyClientConfig.CreateDefault();</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">var server = new EmbedIOAuthServer(new Uri("http://localhost:5000/callback"), 5000);</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">server.AuthorizationCodeReceived += async (sender, response) =></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">{</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> await server.Stop();</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> var tokenResponse = await new OAuthClient(config).RequestToken(new AuthorizationCodeTokenRequest(</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> _clientId, _secretId, response.Code, server.BaseUri</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> ));</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
|
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">// NEW</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">var config = SpotifyClientConfig.CreateDefault();</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">var server = new EmbedIOAuthServer(new Uri("http://localhost:5000/callback"), 5000);</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">server.AuthorizationCodeReceived += async (sender, response) =></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">{</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> await server.Stop();</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> var tokenResponse = await new OAuthClient(config).RequestToken(new AuthorizationCodeTokenRequest(</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> _clientId, _secretId, response.Code, server.BaseUri</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> ));</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
|
||||||
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> var spotify = new SpotifyClient(config.WithToken(tokenResponse.AccessToken));</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">}</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">await server.Start();</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
|
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> var spotify = new SpotifyClient(config.WithToken(tokenResponse.AccessToken));</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">}</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">await server.Start();</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
|
||||||
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">var loginRequest = new LoginRequest(server.BaseUri, _clientId, LoginRequest.ResponseType.Code)</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">{</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> Scope = new[] { Scopes.PlaylistReadPrivate, Scopes.PlaylistReadCollaborative }</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">};</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">BrowserUtil.Open(loginRequest.ToUri());</span></div></div></div></div></div><p>While it is more code to write, there is a better seperation of concerns. For example, it is able to construct a <code>LoginRequest</code> without starting a server. This <code>LoginRequest</code> can also be used to forward the user to in a web-based context. The same auth server <code>EmbedIOAuthServer</code> can be used to receive <code>AuthorizationCodes</code> and <code>ImplictGrants</code> responses.</p></div></article><div class="margin-vert--xl"><div class="row"><div class="col"><a href="https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/docs/5_to_6.md" target="_blank" rel="noreferrer noopener"><svg fill="currentColor" height="1.2em" width="1.2em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 40 40" style="margin-right:0.3em;vertical-align:sub"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col text--right"><em><small>Last updated on <time datetime="2021-03-02T11:19:55.000Z" class="docLastUpdatedAt_1sqk">3/2/2021</time> by <strong>Jonas Dellinger</strong></small></em></div></div></div><div class="margin-vert--lg"><nav class="pagination-nav"><div class="pagination-nav__item"><a class="pagination-nav__link" href="/SpotifyAPI-NET/docs/next/example_uwp"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">« UWP</div></a></div><div class="pagination-nav__item pagination-nav__item--next"></div></nav></div></div></div><div class="col col--3"><div class="tableOfContents_TbNY"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#spotifyapiweb" class="table-of-contents__link">SpotifyAPI.Web</a><ul><li><a href="#initialization" class="table-of-contents__link">Initialization</a></li><li><a href="#proxy" class="table-of-contents__link">Proxy</a></li><li><a href="#calling-api-endpoints" class="table-of-contents__link">Calling API Endpoints</a></li><li><a href="#errorheader-handling" class="table-of-contents__link">Error/Header Handling</a></li></ul></li><li><a href="#spotifyapiwebauth" class="table-of-contents__link">SpotifyAPI.Web.Auth</a><ul><li><a href="#authorization-code-auth" class="table-of-contents__link">Authorization Code Auth</a></li></ul></li></ul></div></div></div></div></main></div></div><footer class="footer footer--dark"><div class="container"><div class="text--center"><div>Copyright © 2021 Jonas Dellinger. Built with Docusaurus.</div></div></div></footer></div>
|
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">var loginRequest = new LoginRequest(server.BaseUri, _clientId, LoginRequest.ResponseType.Code)</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">{</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> Scope = new[] { Scopes.PlaylistReadPrivate, Scopes.PlaylistReadCollaborative }</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">};</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">BrowserUtil.Open(loginRequest.ToUri());</span></div></div></div></div></div><p>While it is more code to write, there is a better seperation of concerns. For example, it is able to construct a <code>LoginRequest</code> without starting a server. This <code>LoginRequest</code> can also be used to forward the user to in a web-based context. The same auth server <code>EmbedIOAuthServer</code> can be used to receive <code>AuthorizationCodes</code> and <code>ImplictGrants</code> responses.</p></div></article><div class="margin-vert--xl"><div class="row"><div class="col"><a href="https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/docs/5_to_6.md" target="_blank" rel="noreferrer noopener"><svg fill="currentColor" height="1.2em" width="1.2em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 40 40" style="margin-right:0.3em;vertical-align:sub"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col text--right"><em><small>Last updated on <time datetime="2021-03-03T08:36:46.000Z" class="docLastUpdatedAt_1sqk">3/3/2021</time> by <strong>Jonas Dellinger</strong></small></em></div></div></div><div class="margin-vert--lg"><nav class="pagination-nav"><div class="pagination-nav__item"><a class="pagination-nav__link" href="/SpotifyAPI-NET/docs/next/example_uwp"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">« UWP</div></a></div><div class="pagination-nav__item pagination-nav__item--next"></div></nav></div></div></div><div class="col col--3"><div class="tableOfContents_TbNY"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#spotifyapiweb" class="table-of-contents__link">SpotifyAPI.Web</a><ul><li><a href="#initialization" class="table-of-contents__link">Initialization</a></li><li><a href="#proxy" class="table-of-contents__link">Proxy</a></li><li><a href="#calling-api-endpoints" class="table-of-contents__link">Calling API Endpoints</a></li><li><a href="#errorheader-handling" class="table-of-contents__link">Error/Header Handling</a></li></ul></li><li><a href="#spotifyapiwebauth" class="table-of-contents__link">SpotifyAPI.Web.Auth</a><ul><li><a href="#authorization-code-auth" class="table-of-contents__link">Authorization Code Auth</a></li></ul></li></ul></div></div></div></div></main></div></div><footer class="footer footer--dark"><div class="container"><div class="text--center"><div>Copyright © 2021 Jonas Dellinger. Built with Docusaurus.</div></div></div></footer></div>
|
||||||
<script src="/SpotifyAPI-NET/styles.20e5fb07.js"></script>
|
<script src="/SpotifyAPI-NET/styles.20e5fb07.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/runtime~main.df71fe3f.js"></script>
|
<script src="/SpotifyAPI-NET/runtime~main.059d8efb.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/main.b4c50bf9.js"></script>
|
<script src="/SpotifyAPI-NET/main.b4c50bf9.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/1.d763968b.js"></script>
|
<script src="/SpotifyAPI-NET/1.d763968b.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/2.c001a4a7.js"></script>
|
<script src="/SpotifyAPI-NET/2.c001a4a7.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/3.c31fd0fb.js"></script>
|
<script src="/SpotifyAPI-NET/3.c31fd0fb.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/1be78505.6d7d8bd2.js"></script>
|
<script src="/SpotifyAPI-NET/1be78505.6d7d8bd2.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/ad407b76.90023bdf.js"></script>
|
<script src="/SpotifyAPI-NET/ad407b76.90023bdf.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/16b2da92.d2778896.js"></script>
|
<script src="/SpotifyAPI-NET/16b2da92.0cd8969f.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
File diff suppressed because one or more lines are too long
@ -6,14 +6,14 @@
|
|||||||
<meta name="generator" content="Docusaurus v2.0.0-alpha.56">
|
<meta name="generator" content="Docusaurus v2.0.0-alpha.56">
|
||||||
<title data-react-helmet="true">Authorization Code | SpotifyAPI-NET</title><meta data-react-helmet="true" name="docsearch:version" content="next"><meta data-react-helmet="true" name="twitter:card" content="summary_large_image"><meta data-react-helmet="true" property="og:title" content="Authorization Code | SpotifyAPI-NET"><meta data-react-helmet="true" name="description" content="This flow is suitable for long-running applications in which the user grants permission only once. It provides an access token that can be refreshed. Since the token exchange involves sending your secret key, perform this on a secure location, like a backend service, and not from a client such as a browser or from a mobile app."><meta data-react-helmet="true" property="og:description" content="This flow is suitable for long-running applications in which the user grants permission only once. It provides an access token that can be refreshed. Since the token exchange involves sending your secret key, perform this on a secure location, like a backend service, and not from a client such as a browser or from a mobile app."><meta data-react-helmet="true" property="og:url" content="https://johnnycrazy.github.io/SpotifyAPI-NET/docs/next/authorization_code"><link data-react-helmet="true" rel="shortcut icon" href="/SpotifyAPI-NET/img/favicon.ico"><link data-react-helmet="true" rel="canonical" href="https://johnnycrazy.github.io/SpotifyAPI-NET/docs/next/authorization_code"><link rel="stylesheet" href="/SpotifyAPI-NET/styles.8a053330.css">
|
<title data-react-helmet="true">Authorization Code | SpotifyAPI-NET</title><meta data-react-helmet="true" name="docsearch:version" content="next"><meta data-react-helmet="true" name="twitter:card" content="summary_large_image"><meta data-react-helmet="true" property="og:title" content="Authorization Code | SpotifyAPI-NET"><meta data-react-helmet="true" name="description" content="This flow is suitable for long-running applications in which the user grants permission only once. It provides an access token that can be refreshed. Since the token exchange involves sending your secret key, perform this on a secure location, like a backend service, and not from a client such as a browser or from a mobile app."><meta data-react-helmet="true" property="og:description" content="This flow is suitable for long-running applications in which the user grants permission only once. It provides an access token that can be refreshed. Since the token exchange involves sending your secret key, perform this on a secure location, like a backend service, and not from a client such as a browser or from a mobile app."><meta data-react-helmet="true" property="og:url" content="https://johnnycrazy.github.io/SpotifyAPI-NET/docs/next/authorization_code"><link data-react-helmet="true" rel="shortcut icon" href="/SpotifyAPI-NET/img/favicon.ico"><link data-react-helmet="true" rel="canonical" href="https://johnnycrazy.github.io/SpotifyAPI-NET/docs/next/authorization_code"><link rel="stylesheet" href="/SpotifyAPI-NET/styles.8a053330.css">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/styles.20e5fb07.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/styles.20e5fb07.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/runtime~main.df71fe3f.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/runtime~main.059d8efb.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/main.b4c50bf9.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/main.b4c50bf9.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/1.d763968b.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/1.d763968b.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/2.c001a4a7.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/2.c001a4a7.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/3.c31fd0fb.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/3.c31fd0fb.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/1be78505.6d7d8bd2.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/1be78505.6d7d8bd2.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/ad407b76.90023bdf.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/ad407b76.90023bdf.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/d85a39be.c5c9f2d2.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/d85a39be.0716c42e.js" as="script">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=window.matchMedia("(prefers-color-scheme: dark)"),n=function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();null!==n?t(n):e.matches&&t("dark")}()</script><div id="__docusaurus">
|
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=window.matchMedia("(prefers-color-scheme: dark)"),n=function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();null!==n?t(n):e.matches&&t("dark")}()</script><div id="__docusaurus">
|
||||||
@ -26,15 +26,15 @@
|
|||||||
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> var request = new LoginRequest(_server.BaseUri, "ClientId", LoginRequest.ResponseType.Code)</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> {</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> Scope = new List<string> { Scopes.UserReadEmail }</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> };</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> BrowserUtil.Open(uri);</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">}</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
|
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> var request = new LoginRequest(_server.BaseUri, "ClientId", LoginRequest.ResponseType.Code)</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> {</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> Scope = new List<string> { Scopes.UserReadEmail }</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> };</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> BrowserUtil.Open(uri);</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">}</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
|
||||||
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">private static async Task OnAuthorizationCodeReceived(object sender, AuthorizationCodeResponse response)</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">{</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> await _server.Stop();</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
|
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">private static async Task OnAuthorizationCodeReceived(object sender, AuthorizationCodeResponse response)</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">{</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> await _server.Stop();</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
|
||||||
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> var config = SpotifyClientConfig.CreateDefault();</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> var tokenResponse = await new OAuthClient(config).RequestToken(</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> new AuthorizationCodeTokenRequest(</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> "ClientId", "ClientSecret", response.Code, "http://localhost:5000/callback"</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> )</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> );</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
|
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> var config = SpotifyClientConfig.CreateDefault();</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> var tokenResponse = await new OAuthClient(config).RequestToken(</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> new AuthorizationCodeTokenRequest(</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> "ClientId", "ClientSecret", response.Code, "http://localhost:5000/callback"</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> )</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> );</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
|
||||||
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> var spotify = new SpotifyClient(tokenResponse.AccessToken);</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> // do calls with Spotify and save token?</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">}</span></div></div></div></div></div><p>For real examples, have a look at <a href="https://github.com/JohnnyCrazy/SpotifyAPI-NET/tree/master/SpotifyAPI.Web.Examples/Example.CLI.PersistentConfig">Example.CLI.PersistentConfig</a> and <a href="https://github.com/JohnnyCrazy/SpotifyAPI-NET/tree/master/SpotifyAPI.Web.Examples/Example.CLI.CustomHTML">Example.CLI.CustomHTML</a></p></div></article><div class="margin-vert--xl"><div class="row"><div class="col"><a href="https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/docs/authorization_code.md" target="_blank" rel="noreferrer noopener"><svg fill="currentColor" height="1.2em" width="1.2em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 40 40" style="margin-right:0.3em;vertical-align:sub"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col text--right"><em><small>Last updated on <time datetime="2021-03-02T11:19:55.000Z" class="docLastUpdatedAt_1sqk">3/2/2021</time> by <strong>Jonas Dellinger</strong></small></em></div></div></div><div class="margin-vert--lg"><nav class="pagination-nav"><div class="pagination-nav__item"><a class="pagination-nav__link" href="/SpotifyAPI-NET/docs/next/implicit_grant"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">« Implicit Grant</div></a></div><div class="pagination-nav__item pagination-nav__item--next"><a class="pagination-nav__link" href="/SpotifyAPI-NET/docs/next/pkce"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">PKCE »</div></a></div></nav></div></div></div><div class="col col--3"><div class="tableOfContents_TbNY"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#existing-web-server" class="table-of-contents__link">Existing Web-Server</a></li><li><a href="#using-spotifywebauth" class="table-of-contents__link">Using Spotify.Web.Auth</a></li></ul></div></div></div></div></main></div></div><footer class="footer footer--dark"><div class="container"><div class="text--center"><div>Copyright © 2021 Jonas Dellinger. Built with Docusaurus.</div></div></div></footer></div>
|
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> var spotify = new SpotifyClient(tokenResponse.AccessToken);</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> // do calls with Spotify and save token?</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">}</span></div></div></div></div></div><p>For real examples, have a look at <a href="https://github.com/JohnnyCrazy/SpotifyAPI-NET/tree/master/SpotifyAPI.Web.Examples/Example.CLI.PersistentConfig">Example.CLI.PersistentConfig</a> and <a href="https://github.com/JohnnyCrazy/SpotifyAPI-NET/tree/master/SpotifyAPI.Web.Examples/Example.CLI.CustomHTML">Example.CLI.CustomHTML</a></p></div></article><div class="margin-vert--xl"><div class="row"><div class="col"><a href="https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/docs/authorization_code.md" target="_blank" rel="noreferrer noopener"><svg fill="currentColor" height="1.2em" width="1.2em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 40 40" style="margin-right:0.3em;vertical-align:sub"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col text--right"><em><small>Last updated on <time datetime="2021-03-03T08:36:46.000Z" class="docLastUpdatedAt_1sqk">3/3/2021</time> by <strong>Jonas Dellinger</strong></small></em></div></div></div><div class="margin-vert--lg"><nav class="pagination-nav"><div class="pagination-nav__item"><a class="pagination-nav__link" href="/SpotifyAPI-NET/docs/next/implicit_grant"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">« Implicit Grant</div></a></div><div class="pagination-nav__item pagination-nav__item--next"><a class="pagination-nav__link" href="/SpotifyAPI-NET/docs/next/pkce"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">PKCE »</div></a></div></nav></div></div></div><div class="col col--3"><div class="tableOfContents_TbNY"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#existing-web-server" class="table-of-contents__link">Existing Web-Server</a></li><li><a href="#using-spotifywebauth" class="table-of-contents__link">Using Spotify.Web.Auth</a></li></ul></div></div></div></div></main></div></div><footer class="footer footer--dark"><div class="container"><div class="text--center"><div>Copyright © 2021 Jonas Dellinger. Built with Docusaurus.</div></div></div></footer></div>
|
||||||
<script src="/SpotifyAPI-NET/styles.20e5fb07.js"></script>
|
<script src="/SpotifyAPI-NET/styles.20e5fb07.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/runtime~main.df71fe3f.js"></script>
|
<script src="/SpotifyAPI-NET/runtime~main.059d8efb.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/main.b4c50bf9.js"></script>
|
<script src="/SpotifyAPI-NET/main.b4c50bf9.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/1.d763968b.js"></script>
|
<script src="/SpotifyAPI-NET/1.d763968b.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/2.c001a4a7.js"></script>
|
<script src="/SpotifyAPI-NET/2.c001a4a7.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/3.c31fd0fb.js"></script>
|
<script src="/SpotifyAPI-NET/3.c31fd0fb.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/1be78505.6d7d8bd2.js"></script>
|
<script src="/SpotifyAPI-NET/1be78505.6d7d8bd2.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/ad407b76.90023bdf.js"></script>
|
<script src="/SpotifyAPI-NET/ad407b76.90023bdf.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/d85a39be.c5c9f2d2.js"></script>
|
<script src="/SpotifyAPI-NET/d85a39be.0716c42e.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@ -6,14 +6,14 @@
|
|||||||
<meta name="generator" content="Docusaurus v2.0.0-alpha.56">
|
<meta name="generator" content="Docusaurus v2.0.0-alpha.56">
|
||||||
<title data-react-helmet="true">Client Credentials | SpotifyAPI-NET</title><meta data-react-helmet="true" name="docsearch:version" content="next"><meta data-react-helmet="true" name="twitter:card" content="summary_large_image"><meta data-react-helmet="true" property="og:title" content="Client Credentials | SpotifyAPI-NET"><meta data-react-helmet="true" name="description" content="The Client Credentials flow is used in server-to-server authentication."><meta data-react-helmet="true" property="og:description" content="The Client Credentials flow is used in server-to-server authentication."><meta data-react-helmet="true" property="og:url" content="https://johnnycrazy.github.io/SpotifyAPI-NET/docs/next/client_credentials"><link data-react-helmet="true" rel="shortcut icon" href="/SpotifyAPI-NET/img/favicon.ico"><link data-react-helmet="true" rel="canonical" href="https://johnnycrazy.github.io/SpotifyAPI-NET/docs/next/client_credentials"><link rel="stylesheet" href="/SpotifyAPI-NET/styles.8a053330.css">
|
<title data-react-helmet="true">Client Credentials | SpotifyAPI-NET</title><meta data-react-helmet="true" name="docsearch:version" content="next"><meta data-react-helmet="true" name="twitter:card" content="summary_large_image"><meta data-react-helmet="true" property="og:title" content="Client Credentials | SpotifyAPI-NET"><meta data-react-helmet="true" name="description" content="The Client Credentials flow is used in server-to-server authentication."><meta data-react-helmet="true" property="og:description" content="The Client Credentials flow is used in server-to-server authentication."><meta data-react-helmet="true" property="og:url" content="https://johnnycrazy.github.io/SpotifyAPI-NET/docs/next/client_credentials"><link data-react-helmet="true" rel="shortcut icon" href="/SpotifyAPI-NET/img/favicon.ico"><link data-react-helmet="true" rel="canonical" href="https://johnnycrazy.github.io/SpotifyAPI-NET/docs/next/client_credentials"><link rel="stylesheet" href="/SpotifyAPI-NET/styles.8a053330.css">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/styles.20e5fb07.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/styles.20e5fb07.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/runtime~main.df71fe3f.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/runtime~main.059d8efb.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/main.b4c50bf9.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/main.b4c50bf9.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/1.d763968b.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/1.d763968b.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/2.c001a4a7.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/2.c001a4a7.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/3.c31fd0fb.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/3.c31fd0fb.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/1be78505.6d7d8bd2.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/1be78505.6d7d8bd2.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/ad407b76.90023bdf.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/ad407b76.90023bdf.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/6373637a.fe9f6bca.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/6373637a.670466ad.js" as="script">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=window.matchMedia("(prefers-color-scheme: dark)"),n=function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();null!==n?t(n):e.matches&&t("dark")}()</script><div id="__docusaurus">
|
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=window.matchMedia("(prefers-color-scheme: dark)"),n=function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();null!==n?t(n):e.matches&&t("dark")}()</script><div id="__docusaurus">
|
||||||
@ -21,15 +21,15 @@
|
|||||||
Only endpoints that do not access user information can be accessed.</p></blockquote><p>By supplying your <code>SPOTIFY_CLIENT_ID</code> and <code>SPOTIFY_CLIENT_SECRET</code>, you get an access token.</p><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_ZqCz" id="request-token-once"></a>Request token once<a aria-hidden="true" tabindex="-1" class="hash-link" href="#request-token-once" title="Direct link to heading">#</a></h2><p>To request an access token, build a <code>ClientCredentialsRequest</code> and send it via <code>OAuthClient</code>. This access token will expire after some time and you need to repeat the process.</p><div class="mdxCodeBlock_iHAB"><div class="codeBlockContent_32p_"><button type="button" aria-label="Copy code to clipboard" class="copyButton_1BYj">Copy</button><div tabindex="0" class="prism-code language-csharp codeBlock_19pQ"><div class="codeBlockLines_2n9r" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token plain">public static async Task Main()</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">{</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> var config = SpotifyClientConfig.CreateDefault();</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
|
Only endpoints that do not access user information can be accessed.</p></blockquote><p>By supplying your <code>SPOTIFY_CLIENT_ID</code> and <code>SPOTIFY_CLIENT_SECRET</code>, you get an access token.</p><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_ZqCz" id="request-token-once"></a>Request token once<a aria-hidden="true" tabindex="-1" class="hash-link" href="#request-token-once" title="Direct link to heading">#</a></h2><p>To request an access token, build a <code>ClientCredentialsRequest</code> and send it via <code>OAuthClient</code>. This access token will expire after some time and you need to repeat the process.</p><div class="mdxCodeBlock_iHAB"><div class="codeBlockContent_32p_"><button type="button" aria-label="Copy code to clipboard" class="copyButton_1BYj">Copy</button><div tabindex="0" class="prism-code language-csharp codeBlock_19pQ"><div class="codeBlockLines_2n9r" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token plain">public static async Task Main()</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">{</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> var config = SpotifyClientConfig.CreateDefault();</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
|
||||||
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> var request = new ClientCredentialsRequest("CLIENT_ID", "CLIENT_SECRET");</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> var response = await new OAuthClient(config).RequestToken(request);</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
|
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> var request = new ClientCredentialsRequest("CLIENT_ID", "CLIENT_SECRET");</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> var response = await new OAuthClient(config).RequestToken(request);</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
|
||||||
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> var spotify = new SpotifyClient(config.WithToken(response.AccessToken));</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">}</span></div></div></div></div></div><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_ZqCz" id="request-token-on-demand"></a>Request Token On-Demand<a aria-hidden="true" tabindex="-1" class="hash-link" href="#request-token-on-demand" title="Direct link to heading">#</a></h2><p>You can also use <code>CredentialsAuthenticator</code>, which will make sure the Spotify instance will always have an up-to-date access token by automatically refreshing the token on demand.</p><div class="mdxCodeBlock_iHAB"><div class="codeBlockContent_32p_"><button type="button" aria-label="Copy code to clipboard" class="copyButton_1BYj">Copy</button><div tabindex="0" class="prism-code language-csharp codeBlock_19pQ"><div class="codeBlockLines_2n9r" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token plain">public static async Task Main()</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">{</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> var config = SpotifyClientConfig</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> .CreateDefault()</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> .WithAuthenticator(new ClientCredentialsAuthenticator("CLIENT_ID", "CLIENT_SECRET"));</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
|
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> var spotify = new SpotifyClient(config.WithToken(response.AccessToken));</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">}</span></div></div></div></div></div><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_ZqCz" id="request-token-on-demand"></a>Request Token On-Demand<a aria-hidden="true" tabindex="-1" class="hash-link" href="#request-token-on-demand" title="Direct link to heading">#</a></h2><p>You can also use <code>CredentialsAuthenticator</code>, which will make sure the Spotify instance will always have an up-to-date access token by automatically refreshing the token on demand.</p><div class="mdxCodeBlock_iHAB"><div class="codeBlockContent_32p_"><button type="button" aria-label="Copy code to clipboard" class="copyButton_1BYj">Copy</button><div tabindex="0" class="prism-code language-csharp codeBlock_19pQ"><div class="codeBlockLines_2n9r" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token plain">public static async Task Main()</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">{</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> var config = SpotifyClientConfig</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> .CreateDefault()</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> .WithAuthenticator(new ClientCredentialsAuthenticator("CLIENT_ID", "CLIENT_SECRET"));</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
|
||||||
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> var spotify = new SpotifyClient(config);</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">}</span></div></div></div></div></div><div class="admonition admonition-info alert alert--info"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</h5></div><div class="admonition-content"><p>Thread safety is not guaranteed when using <code>CredentialsAuthenticator</code>.</p></div></div></div></article><div class="margin-vert--xl"><div class="row"><div class="col"><a href="https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/docs/client_credentials.md" target="_blank" rel="noreferrer noopener"><svg fill="currentColor" height="1.2em" width="1.2em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 40 40" style="margin-right:0.3em;vertical-align:sub"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col text--right"><em><small>Last updated on <time datetime="2021-03-02T11:19:55.000Z" class="docLastUpdatedAt_1sqk">3/2/2021</time> by <strong>Jonas Dellinger</strong></small></em></div></div></div><div class="margin-vert--lg"><nav class="pagination-nav"><div class="pagination-nav__item"><a class="pagination-nav__link" href="/SpotifyAPI-NET/docs/next/auth_introduction"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">« Introduction</div></a></div><div class="pagination-nav__item pagination-nav__item--next"><a class="pagination-nav__link" href="/SpotifyAPI-NET/docs/next/implicit_grant"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Implicit Grant »</div></a></div></nav></div></div></div><div class="col col--3"><div class="tableOfContents_TbNY"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#request-token-once" class="table-of-contents__link">Request token once</a></li><li><a href="#request-token-on-demand" class="table-of-contents__link">Request Token On-Demand</a></li></ul></div></div></div></div></main></div></div><footer class="footer footer--dark"><div class="container"><div class="text--center"><div>Copyright © 2021 Jonas Dellinger. Built with Docusaurus.</div></div></div></footer></div>
|
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> var spotify = new SpotifyClient(config);</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">}</span></div></div></div></div></div><div class="admonition admonition-info alert alert--info"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</h5></div><div class="admonition-content"><p>Thread safety is not guaranteed when using <code>CredentialsAuthenticator</code>.</p></div></div></div></article><div class="margin-vert--xl"><div class="row"><div class="col"><a href="https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/docs/client_credentials.md" target="_blank" rel="noreferrer noopener"><svg fill="currentColor" height="1.2em" width="1.2em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 40 40" style="margin-right:0.3em;vertical-align:sub"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col text--right"><em><small>Last updated on <time datetime="2021-03-03T08:36:46.000Z" class="docLastUpdatedAt_1sqk">3/3/2021</time> by <strong>Jonas Dellinger</strong></small></em></div></div></div><div class="margin-vert--lg"><nav class="pagination-nav"><div class="pagination-nav__item"><a class="pagination-nav__link" href="/SpotifyAPI-NET/docs/next/auth_introduction"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">« Introduction</div></a></div><div class="pagination-nav__item pagination-nav__item--next"><a class="pagination-nav__link" href="/SpotifyAPI-NET/docs/next/implicit_grant"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Implicit Grant »</div></a></div></nav></div></div></div><div class="col col--3"><div class="tableOfContents_TbNY"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#request-token-once" class="table-of-contents__link">Request token once</a></li><li><a href="#request-token-on-demand" class="table-of-contents__link">Request Token On-Demand</a></li></ul></div></div></div></div></main></div></div><footer class="footer footer--dark"><div class="container"><div class="text--center"><div>Copyright © 2021 Jonas Dellinger. Built with Docusaurus.</div></div></div></footer></div>
|
||||||
<script src="/SpotifyAPI-NET/styles.20e5fb07.js"></script>
|
<script src="/SpotifyAPI-NET/styles.20e5fb07.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/runtime~main.df71fe3f.js"></script>
|
<script src="/SpotifyAPI-NET/runtime~main.059d8efb.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/main.b4c50bf9.js"></script>
|
<script src="/SpotifyAPI-NET/main.b4c50bf9.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/1.d763968b.js"></script>
|
<script src="/SpotifyAPI-NET/1.d763968b.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/2.c001a4a7.js"></script>
|
<script src="/SpotifyAPI-NET/2.c001a4a7.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/3.c31fd0fb.js"></script>
|
<script src="/SpotifyAPI-NET/3.c31fd0fb.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/1be78505.6d7d8bd2.js"></script>
|
<script src="/SpotifyAPI-NET/1be78505.6d7d8bd2.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/ad407b76.90023bdf.js"></script>
|
<script src="/SpotifyAPI-NET/ad407b76.90023bdf.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/6373637a.fe9f6bca.js"></script>
|
<script src="/SpotifyAPI-NET/6373637a.670466ad.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -6,14 +6,14 @@
|
|||||||
<meta name="generator" content="Docusaurus v2.0.0-alpha.56">
|
<meta name="generator" content="Docusaurus v2.0.0-alpha.56">
|
||||||
<title data-react-helmet="true">Implicit Grant | SpotifyAPI-NET</title><meta data-react-helmet="true" name="docsearch:version" content="next"><meta data-react-helmet="true" name="twitter:card" content="summary_large_image"><meta data-react-helmet="true" property="og:title" content="Implicit Grant | SpotifyAPI-NET"><meta data-react-helmet="true" name="description" content="Implicit grant flow is for clients that are implemented entirely using JavaScript and running in the resource owner’s browser. You do not need any server-side code to use it. Rate limits for requests are improved but there is no refresh token provided. This flow is described in RFC-6749."><meta data-react-helmet="true" property="og:description" content="Implicit grant flow is for clients that are implemented entirely using JavaScript and running in the resource owner’s browser. You do not need any server-side code to use it. Rate limits for requests are improved but there is no refresh token provided. This flow is described in RFC-6749."><meta data-react-helmet="true" property="og:url" content="https://johnnycrazy.github.io/SpotifyAPI-NET/docs/next/implicit_grant"><link data-react-helmet="true" rel="shortcut icon" href="/SpotifyAPI-NET/img/favicon.ico"><link data-react-helmet="true" rel="canonical" href="https://johnnycrazy.github.io/SpotifyAPI-NET/docs/next/implicit_grant"><link rel="stylesheet" href="/SpotifyAPI-NET/styles.8a053330.css">
|
<title data-react-helmet="true">Implicit Grant | SpotifyAPI-NET</title><meta data-react-helmet="true" name="docsearch:version" content="next"><meta data-react-helmet="true" name="twitter:card" content="summary_large_image"><meta data-react-helmet="true" property="og:title" content="Implicit Grant | SpotifyAPI-NET"><meta data-react-helmet="true" name="description" content="Implicit grant flow is for clients that are implemented entirely using JavaScript and running in the resource owner’s browser. You do not need any server-side code to use it. Rate limits for requests are improved but there is no refresh token provided. This flow is described in RFC-6749."><meta data-react-helmet="true" property="og:description" content="Implicit grant flow is for clients that are implemented entirely using JavaScript and running in the resource owner’s browser. You do not need any server-side code to use it. Rate limits for requests are improved but there is no refresh token provided. This flow is described in RFC-6749."><meta data-react-helmet="true" property="og:url" content="https://johnnycrazy.github.io/SpotifyAPI-NET/docs/next/implicit_grant"><link data-react-helmet="true" rel="shortcut icon" href="/SpotifyAPI-NET/img/favicon.ico"><link data-react-helmet="true" rel="canonical" href="https://johnnycrazy.github.io/SpotifyAPI-NET/docs/next/implicit_grant"><link rel="stylesheet" href="/SpotifyAPI-NET/styles.8a053330.css">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/styles.20e5fb07.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/styles.20e5fb07.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/runtime~main.df71fe3f.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/runtime~main.059d8efb.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/main.b4c50bf9.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/main.b4c50bf9.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/1.d763968b.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/1.d763968b.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/2.c001a4a7.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/2.c001a4a7.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/3.c31fd0fb.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/3.c31fd0fb.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/1be78505.6d7d8bd2.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/1be78505.6d7d8bd2.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/ad407b76.90023bdf.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/ad407b76.90023bdf.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/266dfd57.4ea9d864.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/266dfd57.1b0d26cc.js" as="script">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=window.matchMedia("(prefers-color-scheme: dark)"),n=function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();null!==n?t(n):e.matches&&t("dark")}()</script><div id="__docusaurus">
|
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=window.matchMedia("(prefers-color-scheme: dark)"),n=function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();null!==n?t(n):e.matches&&t("dark")}()</script><div id="__docusaurus">
|
||||||
@ -23,15 +23,15 @@
|
|||||||
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">public static async Task Main()</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">{</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> // Make sure "http://localhost:5000/callback" is in your spotify application as redirect uri!</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> _server = new EmbedIOAuthServer(new Uri("http://localhost:5000/callback"), 5000);</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> await _server.Start();</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
|
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">public static async Task Main()</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">{</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> // Make sure "http://localhost:5000/callback" is in your spotify application as redirect uri!</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> _server = new EmbedIOAuthServer(new Uri("http://localhost:5000/callback"), 5000);</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> await _server.Start();</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
|
||||||
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> _server.ImplictGrantReceived += OnImplicitGrantReceived;</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
|
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> _server.ImplictGrantReceived += OnImplicitGrantReceived;</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
|
||||||
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> var request = new LoginRequest(_server.BaseUri, "ClientId", LoginRequest.ResponseType.Token)</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> {</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> Scope = new List<string> { Scopes.UserReadEmail }</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> };</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> BrowserUtil.Open(request.ToUri());</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">}</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
|
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> var request = new LoginRequest(_server.BaseUri, "ClientId", LoginRequest.ResponseType.Token)</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> {</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> Scope = new List<string> { Scopes.UserReadEmail }</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> };</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> BrowserUtil.Open(request.ToUri());</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">}</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
|
||||||
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">private static async Task OnImplicitGrantReceived(object sender, ImplictGrantResponse response)</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">{</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> await _server.Stop();</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> var spotify = new SpotifyClient(response.AccessToken);</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> // do calls with Spotify</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">}</span></div></div></div></div></div><p>For real examples, have a look at <a href="https://github.com/JohnnyCrazy/SpotifyAPI-NET/tree/master/SpotifyAPI.Web.Examples/Example.CLI.PersistentConfig">Example.CLI.PersistentConfig</a> and <a href="https://github.com/JohnnyCrazy/SpotifyAPI-NET/tree/master/SpotifyAPI.Web.Examples/Example.CLI.CustomHTML">Example.CLI.CustomHTML</a></p></div></article><div class="margin-vert--xl"><div class="row"><div class="col"><a href="https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/docs/implicit_grant.md" target="_blank" rel="noreferrer noopener"><svg fill="currentColor" height="1.2em" width="1.2em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 40 40" style="margin-right:0.3em;vertical-align:sub"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col text--right"><em><small>Last updated on <time datetime="2021-03-02T11:19:55.000Z" class="docLastUpdatedAt_1sqk">3/2/2021</time> by <strong>Jonas Dellinger</strong></small></em></div></div></div><div class="margin-vert--lg"><nav class="pagination-nav"><div class="pagination-nav__item"><a class="pagination-nav__link" href="/SpotifyAPI-NET/docs/next/client_credentials"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">« Client Credentials</div></a></div><div class="pagination-nav__item pagination-nav__item--next"><a class="pagination-nav__link" href="/SpotifyAPI-NET/docs/next/authorization_code"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Authorization Code »</div></a></div></nav></div></div></div><div class="col col--3"><div class="tableOfContents_TbNY"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#existing-web-server" class="table-of-contents__link">Existing Web-Server</a></li><li><a href="#using-custom-protocols" class="table-of-contents__link">Using custom Protocols</a></li></ul></div></div></div></div></main></div></div><footer class="footer footer--dark"><div class="container"><div class="text--center"><div>Copyright © 2021 Jonas Dellinger. Built with Docusaurus.</div></div></div></footer></div>
|
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">private static async Task OnImplicitGrantReceived(object sender, ImplictGrantResponse response)</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">{</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> await _server.Stop();</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> var spotify = new SpotifyClient(response.AccessToken);</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> // do calls with Spotify</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">}</span></div></div></div></div></div><p>For real examples, have a look at <a href="https://github.com/JohnnyCrazy/SpotifyAPI-NET/tree/master/SpotifyAPI.Web.Examples/Example.CLI.PersistentConfig">Example.CLI.PersistentConfig</a> and <a href="https://github.com/JohnnyCrazy/SpotifyAPI-NET/tree/master/SpotifyAPI.Web.Examples/Example.CLI.CustomHTML">Example.CLI.CustomHTML</a></p></div></article><div class="margin-vert--xl"><div class="row"><div class="col"><a href="https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/docs/implicit_grant.md" target="_blank" rel="noreferrer noopener"><svg fill="currentColor" height="1.2em" width="1.2em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 40 40" style="margin-right:0.3em;vertical-align:sub"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col text--right"><em><small>Last updated on <time datetime="2021-03-03T08:36:46.000Z" class="docLastUpdatedAt_1sqk">3/3/2021</time> by <strong>Jonas Dellinger</strong></small></em></div></div></div><div class="margin-vert--lg"><nav class="pagination-nav"><div class="pagination-nav__item"><a class="pagination-nav__link" href="/SpotifyAPI-NET/docs/next/client_credentials"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">« Client Credentials</div></a></div><div class="pagination-nav__item pagination-nav__item--next"><a class="pagination-nav__link" href="/SpotifyAPI-NET/docs/next/authorization_code"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Authorization Code »</div></a></div></nav></div></div></div><div class="col col--3"><div class="tableOfContents_TbNY"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#existing-web-server" class="table-of-contents__link">Existing Web-Server</a></li><li><a href="#using-custom-protocols" class="table-of-contents__link">Using custom Protocols</a></li></ul></div></div></div></div></main></div></div><footer class="footer footer--dark"><div class="container"><div class="text--center"><div>Copyright © 2021 Jonas Dellinger. Built with Docusaurus.</div></div></div></footer></div>
|
||||||
<script src="/SpotifyAPI-NET/styles.20e5fb07.js"></script>
|
<script src="/SpotifyAPI-NET/styles.20e5fb07.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/runtime~main.df71fe3f.js"></script>
|
<script src="/SpotifyAPI-NET/runtime~main.059d8efb.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/main.b4c50bf9.js"></script>
|
<script src="/SpotifyAPI-NET/main.b4c50bf9.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/1.d763968b.js"></script>
|
<script src="/SpotifyAPI-NET/1.d763968b.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/2.c001a4a7.js"></script>
|
<script src="/SpotifyAPI-NET/2.c001a4a7.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/3.c31fd0fb.js"></script>
|
<script src="/SpotifyAPI-NET/3.c31fd0fb.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/1be78505.6d7d8bd2.js"></script>
|
<script src="/SpotifyAPI-NET/1be78505.6d7d8bd2.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/ad407b76.90023bdf.js"></script>
|
<script src="/SpotifyAPI-NET/ad407b76.90023bdf.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/266dfd57.4ea9d864.js"></script>
|
<script src="/SpotifyAPI-NET/266dfd57.1b0d26cc.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -6,14 +6,14 @@
|
|||||||
<meta name="generator" content="Docusaurus v2.0.0-alpha.56">
|
<meta name="generator" content="Docusaurus v2.0.0-alpha.56">
|
||||||
<title data-react-helmet="true">PKCE | SpotifyAPI-NET</title><meta data-react-helmet="true" name="docsearch:version" content="next"><meta data-react-helmet="true" name="twitter:card" content="summary_large_image"><meta data-react-helmet="true" property="og:title" content="PKCE | SpotifyAPI-NET"><meta data-react-helmet="true" name="description" content="The authorization code flow with PKCE is the best option for mobile and desktop applications where it is unsafe to store your client secret. It provides your app with an access token that can be refreshed. For further information about this flow, see IETF RFC-7636."><meta data-react-helmet="true" property="og:description" content="The authorization code flow with PKCE is the best option for mobile and desktop applications where it is unsafe to store your client secret. It provides your app with an access token that can be refreshed. For further information about this flow, see IETF RFC-7636."><meta data-react-helmet="true" property="og:url" content="https://johnnycrazy.github.io/SpotifyAPI-NET/docs/next/pkce"><link data-react-helmet="true" rel="shortcut icon" href="/SpotifyAPI-NET/img/favicon.ico"><link data-react-helmet="true" rel="canonical" href="https://johnnycrazy.github.io/SpotifyAPI-NET/docs/next/pkce"><link rel="stylesheet" href="/SpotifyAPI-NET/styles.8a053330.css">
|
<title data-react-helmet="true">PKCE | SpotifyAPI-NET</title><meta data-react-helmet="true" name="docsearch:version" content="next"><meta data-react-helmet="true" name="twitter:card" content="summary_large_image"><meta data-react-helmet="true" property="og:title" content="PKCE | SpotifyAPI-NET"><meta data-react-helmet="true" name="description" content="The authorization code flow with PKCE is the best option for mobile and desktop applications where it is unsafe to store your client secret. It provides your app with an access token that can be refreshed. For further information about this flow, see IETF RFC-7636."><meta data-react-helmet="true" property="og:description" content="The authorization code flow with PKCE is the best option for mobile and desktop applications where it is unsafe to store your client secret. It provides your app with an access token that can be refreshed. For further information about this flow, see IETF RFC-7636."><meta data-react-helmet="true" property="og:url" content="https://johnnycrazy.github.io/SpotifyAPI-NET/docs/next/pkce"><link data-react-helmet="true" rel="shortcut icon" href="/SpotifyAPI-NET/img/favicon.ico"><link data-react-helmet="true" rel="canonical" href="https://johnnycrazy.github.io/SpotifyAPI-NET/docs/next/pkce"><link rel="stylesheet" href="/SpotifyAPI-NET/styles.8a053330.css">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/styles.20e5fb07.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/styles.20e5fb07.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/runtime~main.df71fe3f.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/runtime~main.059d8efb.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/main.b4c50bf9.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/main.b4c50bf9.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/1.d763968b.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/1.d763968b.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/2.c001a4a7.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/2.c001a4a7.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/3.c31fd0fb.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/3.c31fd0fb.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/1be78505.6d7d8bd2.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/1be78505.6d7d8bd2.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/ad407b76.90023bdf.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/ad407b76.90023bdf.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/e3c15a47.8a264025.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/e3c15a47.178c4dd5.js" as="script">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=window.matchMedia("(prefers-color-scheme: dark)"),n=function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();null!==n?t(n):e.matches&&t("dark")}()</script><div id="__docusaurus">
|
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=window.matchMedia("(prefers-color-scheme: dark)"),n=function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();null!==n?t(n):e.matches&&t("dark")}()</script><div id="__docusaurus">
|
||||||
@ -22,15 +22,15 @@
|
|||||||
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">// Returns the passed string and its challenge (Make sure it's random and long enough)</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">var (verifier, challenge) = PKCEUtil.GenerateCodes("YourSecureRandomString");</span></div></div></div></div></div><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_ZqCz" id="generating-login-uri"></a>Generating Login URI<a aria-hidden="true" tabindex="-1" class="hash-link" href="#generating-login-uri" title="Direct link to heading">#</a></h2><p>Like most auth flows, you'll need to redirect your user to Spotify's servers so they are able to grant access to your application:</p><div class="mdxCodeBlock_iHAB"><div class="codeBlockContent_32p_"><button type="button" aria-label="Copy code to clipboard" class="copyButton_1BYj">Copy</button><div tabindex="0" class="prism-code language-csharp codeBlock_19pQ"><div class="codeBlockLines_2n9r" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token plain">// Make sure "http://localhost:5000/callback" is in your applications redirect URIs!</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">var loginRequest = new LoginRequest(</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> new Uri("http://localhost:5000/callback"),</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> "YourClientId",</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> LoginRequest.ResponseType.Code</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">)</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">{</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> CodeChallengeMethod = "S256",</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> CodeChallenge = challenge,</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> Scope = new[] { Scopes.PlaylistReadPrivate, Scopes.PlaylistReadCollaborative }</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">};</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">var uri = loginRequest.ToUri();</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">// Redirect user to uri via your favorite web-server or open a local browser window</span></div></div></div></div></div><p>When the user is redirected to the generated uri, they will have to login with their Spotify account and confirm that your application wants to access their user data. Once confirmed, they will be redirected to <code>http://localhost:5000/callback</code> and a <code>code</code> parameter is attached to the query. The redirect URI can also contain a custom protocol paired with UWP App Custom Protocol handler. This received <code>code</code> has to be exchanged for an <code>access_token</code> and <code>refresh_token</code>:</p><div class="mdxCodeBlock_iHAB"><div class="codeBlockContent_32p_"><button type="button" aria-label="Copy code to clipboard" class="copyButton_1BYj">Copy</button><div tabindex="0" class="prism-code language-csharp codeBlock_19pQ"><div class="codeBlockLines_2n9r" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token plain">// This method should be called from your web-server when the user visits "http://localhost:5000/callback"</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">public Task GetCallback(string code)</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">{</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> // Note that we use the verifier calculated above!</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> var initialResponse = await new OAuthClient().RequestToken(</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> new PKCETokenRequest("ClientId", code, "http://localhost:5000", verifier)</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> );</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
|
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">// Returns the passed string and its challenge (Make sure it's random and long enough)</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">var (verifier, challenge) = PKCEUtil.GenerateCodes("YourSecureRandomString");</span></div></div></div></div></div><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_ZqCz" id="generating-login-uri"></a>Generating Login URI<a aria-hidden="true" tabindex="-1" class="hash-link" href="#generating-login-uri" title="Direct link to heading">#</a></h2><p>Like most auth flows, you'll need to redirect your user to Spotify's servers so they are able to grant access to your application:</p><div class="mdxCodeBlock_iHAB"><div class="codeBlockContent_32p_"><button type="button" aria-label="Copy code to clipboard" class="copyButton_1BYj">Copy</button><div tabindex="0" class="prism-code language-csharp codeBlock_19pQ"><div class="codeBlockLines_2n9r" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token plain">// Make sure "http://localhost:5000/callback" is in your applications redirect URIs!</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">var loginRequest = new LoginRequest(</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> new Uri("http://localhost:5000/callback"),</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> "YourClientId",</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> LoginRequest.ResponseType.Code</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">)</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">{</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> CodeChallengeMethod = "S256",</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> CodeChallenge = challenge,</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> Scope = new[] { Scopes.PlaylistReadPrivate, Scopes.PlaylistReadCollaborative }</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">};</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">var uri = loginRequest.ToUri();</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">// Redirect user to uri via your favorite web-server or open a local browser window</span></div></div></div></div></div><p>When the user is redirected to the generated uri, they will have to login with their Spotify account and confirm that your application wants to access their user data. Once confirmed, they will be redirected to <code>http://localhost:5000/callback</code> and a <code>code</code> parameter is attached to the query. The redirect URI can also contain a custom protocol paired with UWP App Custom Protocol handler. This received <code>code</code> has to be exchanged for an <code>access_token</code> and <code>refresh_token</code>:</p><div class="mdxCodeBlock_iHAB"><div class="codeBlockContent_32p_"><button type="button" aria-label="Copy code to clipboard" class="copyButton_1BYj">Copy</button><div tabindex="0" class="prism-code language-csharp codeBlock_19pQ"><div class="codeBlockLines_2n9r" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token plain">// This method should be called from your web-server when the user visits "http://localhost:5000/callback"</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">public Task GetCallback(string code)</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">{</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> // Note that we use the verifier calculated above!</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> var initialResponse = await new OAuthClient().RequestToken(</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> new PKCETokenRequest("ClientId", code, "http://localhost:5000", verifier)</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> );</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
|
||||||
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> var spotify = new SpotifyClient(initialResponse.AccessToken);</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> // Also important for later: response.RefreshToken</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">}</span></div></div></div></div></div><p>With PKCE you can also refresh tokens once they're expired:</p><div class="mdxCodeBlock_iHAB"><div class="codeBlockContent_32p_"><button type="button" aria-label="Copy code to clipboard" class="copyButton_1BYj">Copy</button><div tabindex="0" class="prism-code language-csharp codeBlock_19pQ"><div class="codeBlockLines_2n9r" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token plain">var newResponse = await new OAuthClient().RequestToken(</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> new PKCETokenRefreshRequest("ClientId", initialResponse.RefreshToken)</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">);</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
|
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> var spotify = new SpotifyClient(initialResponse.AccessToken);</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> // Also important for later: response.RefreshToken</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">}</span></div></div></div></div></div><p>With PKCE you can also refresh tokens once they're expired:</p><div class="mdxCodeBlock_iHAB"><div class="codeBlockContent_32p_"><button type="button" aria-label="Copy code to clipboard" class="copyButton_1BYj">Copy</button><div tabindex="0" class="prism-code language-csharp codeBlock_19pQ"><div class="codeBlockLines_2n9r" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token plain">var newResponse = await new OAuthClient().RequestToken(</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> new PKCETokenRefreshRequest("ClientId", initialResponse.RefreshToken)</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">);</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
|
||||||
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">var spotify = new SpotifyClient(newResponse.AccessToken);</span></div></div></div></div></div><p>If you do not want to take care of manually refreshing tokens, you can use <code>PKCEAuthenticator</code>:</p><div class="mdxCodeBlock_iHAB"><div class="codeBlockContent_32p_"><button type="button" aria-label="Copy code to clipboard" class="copyButton_1BYj">Copy</button><div tabindex="0" class="prism-code language-csharp codeBlock_19pQ"><div class="codeBlockLines_2n9r" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token plain">var authenticator = new PKCEAuthenticator(clientId, initialResponse);</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
|
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">var spotify = new SpotifyClient(newResponse.AccessToken);</span></div></div></div></div></div><p>If you do not want to take care of manually refreshing tokens, you can use <code>PKCEAuthenticator</code>:</p><div class="mdxCodeBlock_iHAB"><div class="codeBlockContent_32p_"><button type="button" aria-label="Copy code to clipboard" class="copyButton_1BYj">Copy</button><div tabindex="0" class="prism-code language-csharp codeBlock_19pQ"><div class="codeBlockLines_2n9r" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token plain">var authenticator = new PKCEAuthenticator(clientId, initialResponse);</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
|
||||||
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">var config = SpotifyClientConfig.CreateDefault()</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> .WithAuthenticator(authenticator);</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">var spotify = new SpotifyClient(config);</span></div></div></div></div></div></div></article><div class="margin-vert--xl"><div class="row"><div class="col"><a href="https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/docs/pkce.md" target="_blank" rel="noreferrer noopener"><svg fill="currentColor" height="1.2em" width="1.2em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 40 40" style="margin-right:0.3em;vertical-align:sub"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col text--right"><em><small>Last updated on <time datetime="2021-03-02T11:19:55.000Z" class="docLastUpdatedAt_1sqk">3/2/2021</time> by <strong>Jonas Dellinger</strong></small></em></div></div></div><div class="margin-vert--lg"><nav class="pagination-nav"><div class="pagination-nav__item"><a class="pagination-nav__link" href="/SpotifyAPI-NET/docs/next/authorization_code"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">« Authorization Code</div></a></div><div class="pagination-nav__item pagination-nav__item--next"><a class="pagination-nav__link" href="/SpotifyAPI-NET/docs/next/token_swap"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Token Swap »</div></a></div></nav></div></div></div><div class="col col--3"><div class="tableOfContents_TbNY"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#generating-challenge--verifier" class="table-of-contents__link">Generating Challenge & Verifier</a></li><li><a href="#generating-login-uri" class="table-of-contents__link">Generating Login URI</a></li></ul></div></div></div></div></main></div></div><footer class="footer footer--dark"><div class="container"><div class="text--center"><div>Copyright © 2021 Jonas Dellinger. Built with Docusaurus.</div></div></div></footer></div>
|
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">var config = SpotifyClientConfig.CreateDefault()</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> .WithAuthenticator(authenticator);</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">var spotify = new SpotifyClient(config);</span></div></div></div></div></div></div></article><div class="margin-vert--xl"><div class="row"><div class="col"><a href="https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/docs/pkce.md" target="_blank" rel="noreferrer noopener"><svg fill="currentColor" height="1.2em" width="1.2em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 40 40" style="margin-right:0.3em;vertical-align:sub"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col text--right"><em><small>Last updated on <time datetime="2021-03-03T08:36:46.000Z" class="docLastUpdatedAt_1sqk">3/3/2021</time> by <strong>Jonas Dellinger</strong></small></em></div></div></div><div class="margin-vert--lg"><nav class="pagination-nav"><div class="pagination-nav__item"><a class="pagination-nav__link" href="/SpotifyAPI-NET/docs/next/authorization_code"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">« Authorization Code</div></a></div><div class="pagination-nav__item pagination-nav__item--next"><a class="pagination-nav__link" href="/SpotifyAPI-NET/docs/next/token_swap"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Token Swap »</div></a></div></nav></div></div></div><div class="col col--3"><div class="tableOfContents_TbNY"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#generating-challenge--verifier" class="table-of-contents__link">Generating Challenge & Verifier</a></li><li><a href="#generating-login-uri" class="table-of-contents__link">Generating Login URI</a></li></ul></div></div></div></div></main></div></div><footer class="footer footer--dark"><div class="container"><div class="text--center"><div>Copyright © 2021 Jonas Dellinger. Built with Docusaurus.</div></div></div></footer></div>
|
||||||
<script src="/SpotifyAPI-NET/styles.20e5fb07.js"></script>
|
<script src="/SpotifyAPI-NET/styles.20e5fb07.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/runtime~main.df71fe3f.js"></script>
|
<script src="/SpotifyAPI-NET/runtime~main.059d8efb.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/main.b4c50bf9.js"></script>
|
<script src="/SpotifyAPI-NET/main.b4c50bf9.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/1.d763968b.js"></script>
|
<script src="/SpotifyAPI-NET/1.d763968b.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/2.c001a4a7.js"></script>
|
<script src="/SpotifyAPI-NET/2.c001a4a7.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/3.c31fd0fb.js"></script>
|
<script src="/SpotifyAPI-NET/3.c31fd0fb.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/1be78505.6d7d8bd2.js"></script>
|
<script src="/SpotifyAPI-NET/1be78505.6d7d8bd2.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/ad407b76.90023bdf.js"></script>
|
<script src="/SpotifyAPI-NET/ad407b76.90023bdf.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/e3c15a47.8a264025.js"></script>
|
<script src="/SpotifyAPI-NET/e3c15a47.178c4dd5.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
File diff suppressed because one or more lines are too long
@ -6,14 +6,14 @@
|
|||||||
<meta name="generator" content="Docusaurus v2.0.0-alpha.56">
|
<meta name="generator" content="Docusaurus v2.0.0-alpha.56">
|
||||||
<title data-react-helmet="true">Retry Handling | SpotifyAPI-NET</title><meta data-react-helmet="true" name="docsearch:version" content="next"><meta data-react-helmet="true" name="twitter:card" content="summary_large_image"><meta data-react-helmet="true" property="og:title" content="Retry Handling | SpotifyAPI-NET"><meta data-react-helmet="true" name="description" content="In Error Handling, we already found out that requests can fail. We provide a way to automatically retry requests via retry handlers. Note that, by default, no retries are performed."><meta data-react-helmet="true" property="og:description" content="In Error Handling, we already found out that requests can fail. We provide a way to automatically retry requests via retry handlers. Note that, by default, no retries are performed."><meta data-react-helmet="true" property="og:url" content="https://johnnycrazy.github.io/SpotifyAPI-NET/docs/next/retry_handling"><link data-react-helmet="true" rel="shortcut icon" href="/SpotifyAPI-NET/img/favicon.ico"><link data-react-helmet="true" rel="canonical" href="https://johnnycrazy.github.io/SpotifyAPI-NET/docs/next/retry_handling"><link rel="stylesheet" href="/SpotifyAPI-NET/styles.8a053330.css">
|
<title data-react-helmet="true">Retry Handling | SpotifyAPI-NET</title><meta data-react-helmet="true" name="docsearch:version" content="next"><meta data-react-helmet="true" name="twitter:card" content="summary_large_image"><meta data-react-helmet="true" property="og:title" content="Retry Handling | SpotifyAPI-NET"><meta data-react-helmet="true" name="description" content="In Error Handling, we already found out that requests can fail. We provide a way to automatically retry requests via retry handlers. Note that, by default, no retries are performed."><meta data-react-helmet="true" property="og:description" content="In Error Handling, we already found out that requests can fail. We provide a way to automatically retry requests via retry handlers. Note that, by default, no retries are performed."><meta data-react-helmet="true" property="og:url" content="https://johnnycrazy.github.io/SpotifyAPI-NET/docs/next/retry_handling"><link data-react-helmet="true" rel="shortcut icon" href="/SpotifyAPI-NET/img/favicon.ico"><link data-react-helmet="true" rel="canonical" href="https://johnnycrazy.github.io/SpotifyAPI-NET/docs/next/retry_handling"><link rel="stylesheet" href="/SpotifyAPI-NET/styles.8a053330.css">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/styles.20e5fb07.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/styles.20e5fb07.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/runtime~main.df71fe3f.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/runtime~main.059d8efb.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/main.b4c50bf9.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/main.b4c50bf9.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/1.d763968b.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/1.d763968b.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/2.c001a4a7.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/2.c001a4a7.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/3.c31fd0fb.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/3.c31fd0fb.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/1be78505.6d7d8bd2.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/1be78505.6d7d8bd2.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/ad407b76.90023bdf.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/ad407b76.90023bdf.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/1aaf601c.978cf109.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/1aaf601c.22a07980.js" as="script">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=window.matchMedia("(prefers-color-scheme: dark)"),n=function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();null!==n?t(n):e.matches&&t("dark")}()</script><div id="__docusaurus">
|
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=window.matchMedia("(prefers-color-scheme: dark)"),n=function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();null!==n?t(n):e.matches&&t("dark")}()</script><div id="__docusaurus">
|
||||||
@ -21,15 +21,15 @@
|
|||||||
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> // don't retry:</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> return response;</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
|
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> // don't retry:</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> return response;</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
|
||||||
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> // retry once:</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> var newResponse = retry(request);</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> return newResponse;</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
|
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> // retry once:</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> var newResponse = retry(request);</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> return newResponse;</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
|
||||||
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> // use retry as often as you want, make sure to return a response</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> }</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">}</span></div></div></div></div></div><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_ZqCz" id="simpleretryhandler"></a>SimpleRetryHandler<a aria-hidden="true" tabindex="-1" class="hash-link" href="#simpleretryhandler" title="Direct link to heading">#</a></h2><p>A <code>SimpleRetryHandler</code> is included, which contains the following retry logic:</p><ul><li>Retries the (configurable) status codes: 500, 502, 503 and 429.</li><li><code>RetryAfter</code> - Specifies the delay between retried calls.</li><li><code>RetryTimes</code> - Specifies the maxiumum amount of performed retries per call.</li><li><code>TooManyRequestsConsumesARetry</code> - Whether a failure of type "Too Many Requests" should use up one of the retry attempts.</li></ul><div class="mdxCodeBlock_iHAB"><div class="codeBlockContent_32p_"><button type="button" aria-label="Copy code to clipboard" class="copyButton_1BYj">Copy</button><div tabindex="0" class="prism-code language-csharp codeBlock_19pQ"><div class="codeBlockLines_2n9r" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token plain">var config = SpotifyClientConfig</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> .CreateDefault()</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> .WithRetryHandler(new SimpleRetryHandler() { RetryAfter = TimeSpan.FromSeconds(1) });</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
|
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> // use retry as often as you want, make sure to return a response</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> }</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">}</span></div></div></div></div></div><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_ZqCz" id="simpleretryhandler"></a>SimpleRetryHandler<a aria-hidden="true" tabindex="-1" class="hash-link" href="#simpleretryhandler" title="Direct link to heading">#</a></h2><p>A <code>SimpleRetryHandler</code> is included, which contains the following retry logic:</p><ul><li>Retries the (configurable) status codes: 500, 502, 503 and 429.</li><li><code>RetryAfter</code> - Specifies the delay between retried calls.</li><li><code>RetryTimes</code> - Specifies the maxiumum amount of performed retries per call.</li><li><code>TooManyRequestsConsumesARetry</code> - Whether a failure of type "Too Many Requests" should use up one of the retry attempts.</li></ul><div class="mdxCodeBlock_iHAB"><div class="codeBlockContent_32p_"><button type="button" aria-label="Copy code to clipboard" class="copyButton_1BYj">Copy</button><div tabindex="0" class="prism-code language-csharp codeBlock_19pQ"><div class="codeBlockLines_2n9r" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token plain">var config = SpotifyClientConfig</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> .CreateDefault()</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> .WithRetryHandler(new SimpleRetryHandler() { RetryAfter = TimeSpan.FromSeconds(1) });</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
|
||||||
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">var spotify = new SpotifyClient(config);</span></div></div></div></div></div></div></article><div class="margin-vert--xl"><div class="row"><div class="col"><a href="https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/docs/retry_handling.md" target="_blank" rel="noreferrer noopener"><svg fill="currentColor" height="1.2em" width="1.2em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 40 40" style="margin-right:0.3em;vertical-align:sub"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col text--right"><em><small>Last updated on <time datetime="2021-03-02T11:19:55.000Z" class="docLastUpdatedAt_1sqk">3/2/2021</time> by <strong>Jonas Dellinger</strong></small></em></div></div></div><div class="margin-vert--lg"><nav class="pagination-nav"><div class="pagination-nav__item"><a class="pagination-nav__link" href="/SpotifyAPI-NET/docs/next/pagination"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">« Pagination</div></a></div><div class="pagination-nav__item pagination-nav__item--next"><a class="pagination-nav__link" href="/SpotifyAPI-NET/docs/next/iplayableitem"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">IPlayableItem »</div></a></div></nav></div></div></div><div class="col col--3"><div class="tableOfContents_TbNY"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#simpleretryhandler" class="table-of-contents__link">SimpleRetryHandler</a></li></ul></div></div></div></div></main></div></div><footer class="footer footer--dark"><div class="container"><div class="text--center"><div>Copyright © 2021 Jonas Dellinger. Built with Docusaurus.</div></div></div></footer></div>
|
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">var spotify = new SpotifyClient(config);</span></div></div></div></div></div></div></article><div class="margin-vert--xl"><div class="row"><div class="col"><a href="https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/docs/retry_handling.md" target="_blank" rel="noreferrer noopener"><svg fill="currentColor" height="1.2em" width="1.2em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 40 40" style="margin-right:0.3em;vertical-align:sub"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col text--right"><em><small>Last updated on <time datetime="2021-03-03T08:36:46.000Z" class="docLastUpdatedAt_1sqk">3/3/2021</time> by <strong>Jonas Dellinger</strong></small></em></div></div></div><div class="margin-vert--lg"><nav class="pagination-nav"><div class="pagination-nav__item"><a class="pagination-nav__link" href="/SpotifyAPI-NET/docs/next/pagination"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">« Pagination</div></a></div><div class="pagination-nav__item pagination-nav__item--next"><a class="pagination-nav__link" href="/SpotifyAPI-NET/docs/next/iplayableitem"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">IPlayableItem »</div></a></div></nav></div></div></div><div class="col col--3"><div class="tableOfContents_TbNY"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#simpleretryhandler" class="table-of-contents__link">SimpleRetryHandler</a></li></ul></div></div></div></div></main></div></div><footer class="footer footer--dark"><div class="container"><div class="text--center"><div>Copyright © 2021 Jonas Dellinger. Built with Docusaurus.</div></div></div></footer></div>
|
||||||
<script src="/SpotifyAPI-NET/styles.20e5fb07.js"></script>
|
<script src="/SpotifyAPI-NET/styles.20e5fb07.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/runtime~main.df71fe3f.js"></script>
|
<script src="/SpotifyAPI-NET/runtime~main.059d8efb.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/main.b4c50bf9.js"></script>
|
<script src="/SpotifyAPI-NET/main.b4c50bf9.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/1.d763968b.js"></script>
|
<script src="/SpotifyAPI-NET/1.d763968b.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/2.c001a4a7.js"></script>
|
<script src="/SpotifyAPI-NET/2.c001a4a7.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/3.c31fd0fb.js"></script>
|
<script src="/SpotifyAPI-NET/3.c31fd0fb.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/1be78505.6d7d8bd2.js"></script>
|
<script src="/SpotifyAPI-NET/1be78505.6d7d8bd2.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/ad407b76.90023bdf.js"></script>
|
<script src="/SpotifyAPI-NET/ad407b76.90023bdf.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/1aaf601c.978cf109.js"></script>
|
<script src="/SpotifyAPI-NET/1aaf601c.22a07980.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
|||||||
(window.webpackJsonp=window.webpackJsonp||[]).push([[47],{179:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return i})),n.d(t,"metadata",(function(){return c})),n.d(t,"rightToc",(function(){return p})),n.d(t,"default",(function(){return u}));var r=n(2),o=n(9),a=(n(0),n(188)),i={id:"example_token_swap",title:"Token Swap"},c={id:"example_token_swap",title:"Token Swap",source:"@site/docs/example_token_swap.md",permalink:"/SpotifyAPI-NET/docs/next/example_token_swap",editUrl:"https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/docs/example_token_swap.md",version:"next",lastUpdatedBy:"Jonas Dellinger",lastUpdatedAt:1614683995,sidebar:"docs",previous:{title:"CLI - Persistent Config",permalink:"/SpotifyAPI-NET/docs/next/example_cli_persistent_config"},next:{title:"UWP",permalink:"/SpotifyAPI-NET/docs/next/example_uwp"}},p=[],l={rightToc:p};function u(e){var t=e.components,n=Object(o.a)(e,["components"]);return Object(a.b)("wrapper",Object(r.a)({},l,n,{components:t,mdxType:"MDXLayout"}))}u.isMDXComponent=!0},188:function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return d}));var r=n(0),o=n.n(r);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=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])}return o}var l=o.a.createContext({}),u=function(e){var t=o.a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):c({},t,{},e)),n},s=function(e){var t=u(e.components);return o.a.createElement(l.Provider,{value:t},e.children)},f={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},m=Object(r.forwardRef)((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,i=e.parentName,l=p(e,["components","mdxType","originalType","parentName"]),s=u(n),m=r,d=s["".concat(i,".").concat(m)]||s[m]||f[m]||a;return n?o.a.createElement(d,c({ref:t},l,{components:n})):o.a.createElement(d,c({ref:t},l))}));function d(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,i=new Array(a);i[0]=m;var c={};for(var p in t)hasOwnProperty.call(t,p)&&(c[p]=t[p]);c.originalType=e,c.mdxType="string"==typeof e?e:r,i[1]=c;for(var l=2;l<a;l++)i[l]=n[l];return o.a.createElement.apply(null,i)}return o.a.createElement.apply(null,n)}m.displayName="MDXCreateElement"}}]);
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[47],{179:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return i})),n.d(t,"metadata",(function(){return c})),n.d(t,"rightToc",(function(){return p})),n.d(t,"default",(function(){return u}));var r=n(2),o=n(9),a=(n(0),n(188)),i={id:"example_token_swap",title:"Token Swap"},c={id:"example_token_swap",title:"Token Swap",source:"@site/docs/example_token_swap.md",permalink:"/SpotifyAPI-NET/docs/next/example_token_swap",editUrl:"https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/docs/example_token_swap.md",version:"next",lastUpdatedBy:"Jonas Dellinger",lastUpdatedAt:1614760606,sidebar:"docs",previous:{title:"CLI - Persistent Config",permalink:"/SpotifyAPI-NET/docs/next/example_cli_persistent_config"},next:{title:"UWP",permalink:"/SpotifyAPI-NET/docs/next/example_uwp"}},p=[],l={rightToc:p};function u(e){var t=e.components,n=Object(o.a)(e,["components"]);return Object(a.b)("wrapper",Object(r.a)({},l,n,{components:t,mdxType:"MDXLayout"}))}u.isMDXComponent=!0},188:function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return d}));var r=n(0),o=n.n(r);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=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])}return o}var l=o.a.createContext({}),u=function(e){var t=o.a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):c({},t,{},e)),n},s=function(e){var t=u(e.components);return o.a.createElement(l.Provider,{value:t},e.children)},f={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},m=Object(r.forwardRef)((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,i=e.parentName,l=p(e,["components","mdxType","originalType","parentName"]),s=u(n),m=r,d=s["".concat(i,".").concat(m)]||s[m]||f[m]||a;return n?o.a.createElement(d,c({ref:t},l,{components:n})):o.a.createElement(d,c({ref:t},l))}));function d(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,i=new Array(a);i[0]=m;var c={};for(var p in t)hasOwnProperty.call(t,p)&&(c[p]=t[p]);c.originalType=e,c.mdxType="string"==typeof e?e:r,i[1]=c;for(var l=2;l<a;l++)i[l]=n[l];return o.a.createElement.apply(null,i)}return o.a.createElement.apply(null,n)}m.displayName="MDXCreateElement"}}]);
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -6,7 +6,7 @@
|
|||||||
<meta name="generator" content="Docusaurus v2.0.0-alpha.56">
|
<meta name="generator" content="Docusaurus v2.0.0-alpha.56">
|
||||||
<title data-react-helmet="true">SpotifyAPI-NET | SpotifyAPI-NET</title><meta data-react-helmet="true" property="og:title" content="SpotifyAPI-NET | SpotifyAPI-NET"><meta data-react-helmet="true" name="description" content="Documentation for the C# .NET SpotifyAPI-NET Library"><meta data-react-helmet="true" property="og:description" content="Documentation for the C# .NET SpotifyAPI-NET Library"><meta data-react-helmet="true" name="twitter:card" content="summary_large_image"><link data-react-helmet="true" rel="shortcut icon" href="/SpotifyAPI-NET/img/favicon.ico"><link rel="stylesheet" href="/SpotifyAPI-NET/styles.8a053330.css">
|
<title data-react-helmet="true">SpotifyAPI-NET | SpotifyAPI-NET</title><meta data-react-helmet="true" property="og:title" content="SpotifyAPI-NET | SpotifyAPI-NET"><meta data-react-helmet="true" name="description" content="Documentation for the C# .NET SpotifyAPI-NET Library"><meta data-react-helmet="true" property="og:description" content="Documentation for the C# .NET SpotifyAPI-NET Library"><meta data-react-helmet="true" name="twitter:card" content="summary_large_image"><link data-react-helmet="true" rel="shortcut icon" href="/SpotifyAPI-NET/img/favicon.ico"><link rel="stylesheet" href="/SpotifyAPI-NET/styles.8a053330.css">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/styles.20e5fb07.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/styles.20e5fb07.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/runtime~main.df71fe3f.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/runtime~main.059d8efb.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/main.b4c50bf9.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/main.b4c50bf9.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/1.d763968b.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/1.d763968b.js" as="script">
|
||||||
<link rel="preload" href="/SpotifyAPI-NET/2.c001a4a7.js" as="script">
|
<link rel="preload" href="/SpotifyAPI-NET/2.c001a4a7.js" as="script">
|
||||||
@ -19,7 +19,7 @@
|
|||||||
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">var me = await spotify.UserProfile.Current();</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">Console.WriteLine($"Hello there {me.DisplayName}");</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
|
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">var me = await spotify.UserProfile.Current();</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">Console.WriteLine($"Hello there {me.DisplayName}");</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
|
||||||
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">await foreach(</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> var playlist in spotify.Paginate(spotify.Playlists.CurrentUsers())</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">)</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">{</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> Console.WriteLine(playlist.Name);</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">}</span></div></div></div></div></div></div></div></header><main><div class="container"><h2 style="text-align:center;margin-top:30px">Try it out now</h2><div style="padding:10px"><div><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_3zTA tabs__item--active">.NET CLI</li><li role="tab" tabindex="0" aria-selected="false" class="tabs__item tabItem_3zTA">Package Manager</li><li role="tab" tabindex="0" aria-selected="false" class="tabs__item tabItem_3zTA">Package Reference</li></ul><div role="tabpanel" class="margin-vert--md"><div><div class="codeBlockContent_32p_"><button type="button" aria-label="Copy code to clipboard" class="copyButton_1BYj">Copy</button><div tabindex="0" class="prism-code language-shell codeBlock_19pQ"><div class="codeBlockLines_2n9r" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token plain">dotnet </span><span class="token function" style="color:rgb(130, 170, 255)">add</span><span class="token plain"> package SpotifyAPI.Web</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"># Optional Auth module, which includes an embedded HTTP Server for OAuth2</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">dotnet </span><span class="token function" style="color:rgb(130, 170, 255)">add</span><span class="token plain"> package SpotifyAPI.Web.Auth</span></div></div></div></div></div></div></div></div></div><section class="features_P2SU"><div class="container"><div class="row"><div class="col col--4"><div class="text--center"><img class="featureImage_3Xqx" src="/SpotifyAPI-NET/img/undraw_preferences_uuo2.svg" alt="[object Object]"></div><h3>Sane Defaults - Easy To Configure</h3><p><code>SpotifyAPI-NET</code> allows you to quickly integrate with Spotify's Web API by supplying sane configuration defaults from the start. Later on, behaviour can be customized using extensive configuration possibilities.</p></div><div class="col col--4"><div class="text--center"><img class="featureImage_3Xqx" src="/SpotifyAPI-NET/img/undraw_project_completed_w0oq.svg" alt="[object Object]"></div><h3>All API Calls Integrated</h3><p>The Spotify Web API consists of over 74 API calls. <code>SpotifyAPI-NET</code> provides fully typed requests/responses for all of them.</p></div><div class="col col--4"><div class="text--center"><img class="featureImage_3Xqx" src="/SpotifyAPI-NET/img/undraw_Devices_e67q.svg" alt="[object Object]"></div><h3>.NET Standard 2.X</h3><p>With the support of .NET Standard 2.X, <code>SpotifyAPI-NET</code> runs on many platforms, including .NET Core, UWP and Xamarin.Forms (Windows, Android, iOS and Mac)</p></div><div class="col col--4"><div class="text--center"><img class="featureImage_3Xqx" src="/SpotifyAPI-NET/img/undraw_QA_engineers_dg5p.svg" alt="[object Object]"></div><h3>Testable</h3><p><code>SpotifyAPI-NET</code> is built on a modular structure, which allows easy testing through mocks and stubs. Learn more by visiting the <a href="/SpotifyAPI-NET/docs/next/testing">Testing Guide</a></p></div></div></div></section></main></div><footer class="footer footer--dark"><div class="container"><div class="text--center"><div>Copyright © 2021 Jonas Dellinger. Built with Docusaurus.</div></div></div></footer></div>
|
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">await foreach(</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> var playlist in spotify.Paginate(spotify.Playlists.CurrentUsers())</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">)</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">{</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> Console.WriteLine(playlist.Name);</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">}</span></div></div></div></div></div></div></div></header><main><div class="container"><h2 style="text-align:center;margin-top:30px">Try it out now</h2><div style="padding:10px"><div><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_3zTA tabs__item--active">.NET CLI</li><li role="tab" tabindex="0" aria-selected="false" class="tabs__item tabItem_3zTA">Package Manager</li><li role="tab" tabindex="0" aria-selected="false" class="tabs__item tabItem_3zTA">Package Reference</li></ul><div role="tabpanel" class="margin-vert--md"><div><div class="codeBlockContent_32p_"><button type="button" aria-label="Copy code to clipboard" class="copyButton_1BYj">Copy</button><div tabindex="0" class="prism-code language-shell codeBlock_19pQ"><div class="codeBlockLines_2n9r" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token plain">dotnet </span><span class="token function" style="color:rgb(130, 170, 255)">add</span><span class="token plain"> package SpotifyAPI.Web</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"># Optional Auth module, which includes an embedded HTTP Server for OAuth2</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">dotnet </span><span class="token function" style="color:rgb(130, 170, 255)">add</span><span class="token plain"> package SpotifyAPI.Web.Auth</span></div></div></div></div></div></div></div></div></div><section class="features_P2SU"><div class="container"><div class="row"><div class="col col--4"><div class="text--center"><img class="featureImage_3Xqx" src="/SpotifyAPI-NET/img/undraw_preferences_uuo2.svg" alt="[object Object]"></div><h3>Sane Defaults - Easy To Configure</h3><p><code>SpotifyAPI-NET</code> allows you to quickly integrate with Spotify's Web API by supplying sane configuration defaults from the start. Later on, behaviour can be customized using extensive configuration possibilities.</p></div><div class="col col--4"><div class="text--center"><img class="featureImage_3Xqx" src="/SpotifyAPI-NET/img/undraw_project_completed_w0oq.svg" alt="[object Object]"></div><h3>All API Calls Integrated</h3><p>The Spotify Web API consists of over 74 API calls. <code>SpotifyAPI-NET</code> provides fully typed requests/responses for all of them.</p></div><div class="col col--4"><div class="text--center"><img class="featureImage_3Xqx" src="/SpotifyAPI-NET/img/undraw_Devices_e67q.svg" alt="[object Object]"></div><h3>.NET Standard 2.X</h3><p>With the support of .NET Standard 2.X, <code>SpotifyAPI-NET</code> runs on many platforms, including .NET Core, UWP and Xamarin.Forms (Windows, Android, iOS and Mac)</p></div><div class="col col--4"><div class="text--center"><img class="featureImage_3Xqx" src="/SpotifyAPI-NET/img/undraw_QA_engineers_dg5p.svg" alt="[object Object]"></div><h3>Testable</h3><p><code>SpotifyAPI-NET</code> is built on a modular structure, which allows easy testing through mocks and stubs. Learn more by visiting the <a href="/SpotifyAPI-NET/docs/next/testing">Testing Guide</a></p></div></div></div></section></main></div><footer class="footer footer--dark"><div class="container"><div class="text--center"><div>Copyright © 2021 Jonas Dellinger. Built with Docusaurus.</div></div></div></footer></div>
|
||||||
<script src="/SpotifyAPI-NET/styles.20e5fb07.js"></script>
|
<script src="/SpotifyAPI-NET/styles.20e5fb07.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/runtime~main.df71fe3f.js"></script>
|
<script src="/SpotifyAPI-NET/runtime~main.059d8efb.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/main.b4c50bf9.js"></script>
|
<script src="/SpotifyAPI-NET/main.b4c50bf9.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/1.d763968b.js"></script>
|
<script src="/SpotifyAPI-NET/1.d763968b.js"></script>
|
||||||
<script src="/SpotifyAPI-NET/2.c001a4a7.js"></script>
|
<script src="/SpotifyAPI-NET/2.c001a4a7.js"></script>
|
||||||
|
1
runtime~main.059d8efb.js
Normal file
1
runtime~main.059d8efb.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
!function(e){function f(f){for(var d,t,b=f[0],n=f[1],o=f[2],u=0,l=[];u<b.length;u++)t=b[u],Object.prototype.hasOwnProperty.call(r,t)&&r[t]&&l.push(r[t][0]),r[t]=0;for(d in n)Object.prototype.hasOwnProperty.call(n,d)&&(e[d]=n[d]);for(i&&i(f);l.length;)l.shift()();return c.push.apply(c,o||[]),a()}function a(){for(var e,f=0;f<c.length;f++){for(var a=c[f],d=!0,t=1;t<a.length;t++){var n=a[t];0!==r[n]&&(d=!1)}d&&(c.splice(f--,1),e=b(b.s=a[0]))}return e}var d={},r={55:0},c=[];function t(e){return b.p+""+({4:"031dc046",5:"0951e901",6:"10f76bbd",7:"15560a88",8:"16b2da92",9:"17896441",10:"18116e9d",11:"1aaf601c",12:"1be78505",13:"1f220079",14:"22a09cbf",15:"25bfd71f",16:"266dfd57",17:"27d9d47d",18:"2851a227",19:"293befc8",20:"35214713",21:"3abe8fb9",22:"3c5916b7",23:"3d0d8a2f",24:"516486bd",25:"52804278",26:"6373637a",27:"67d5074e",28:"700347c0",29:"73139ff1",30:"755cfc2e",31:"8581bb41",32:"8ddd655f",33:"9008bace",34:"902b04f6",35:"92bb876c",36:"9ed00105",37:"a09c2993",38:"a1189d06",39:"ad407b76",40:"b5ab5f4e",41:"bbb8f1f8",42:"c4f5d8e4",43:"cd5a7ece",44:"d0e245df",45:"d85a39be",46:"dd053733",47:"e02badcb",48:"e06aacec",49:"e27d08ab",50:"e3c15a47",51:"e6afeee9",52:"e8057f2a",53:"fbd836ef"}[e]||e)+"."+{1:"d763968b",2:"c001a4a7",3:"c31fd0fb",4:"f231dfaf",5:"0dc1a29f",6:"03bf3cdf",7:"7b27c8fb",8:"0cd8969f",9:"26bac051",10:"baba9a4f",11:"22a07980",12:"6d7d8bd2",13:"fc586d47",14:"2feafdcf",15:"2b0f0275",16:"1b0d26cc",17:"67d4d434",18:"c6ceb12e",19:"f72ff265",20:"ae5b9306",21:"1c60139d",22:"d45e6a39",23:"44e5d4a3",24:"02858ded",25:"e0b7ff3f",26:"670466ad",27:"07e53967",28:"4af59892",29:"f13941d2",30:"865f8f05",31:"6cbbc1e9",32:"d6a4b966",33:"1e6d4f9a",34:"db32b54e",35:"33047d1c",36:"4efd0456",37:"3cfab429",38:"ef89c6b1",39:"90023bdf",40:"a9bfa357",41:"8ef65a02",42:"993db86e",43:"7b24b01b",44:"e4596e73",45:"0716c42e",46:"b873079e",47:"0dcd52fd",48:"b2076f2b",49:"6e31891b",50:"178c4dd5",51:"f18a00e6",52:"22ca4119",53:"40616636",56:"c99bee3c"}[e]+".js"}function b(f){if(d[f])return d[f].exports;var a=d[f]={i:f,l:!1,exports:{}};return e[f].call(a.exports,a,a.exports,b),a.l=!0,a.exports}b.e=function(e){var f=[],a=r[e];if(0!==a)if(a)f.push(a[2]);else{var d=new Promise((function(f,d){a=r[e]=[f,d]}));f.push(a[2]=d);var c,n=document.createElement("script");n.charset="utf-8",n.timeout=120,b.nc&&n.setAttribute("nonce",b.nc),n.src=t(e);var o=new Error;c=function(f){n.onerror=n.onload=null,clearTimeout(u);var a=r[e];if(0!==a){if(a){var d=f&&("load"===f.type?"missing":f.type),c=f&&f.target&&f.target.src;o.message="Loading chunk "+e+" failed.\n("+d+": "+c+")",o.name="ChunkLoadError",o.type=d,o.request=c,a[1](o)}r[e]=void 0}};var u=setTimeout((function(){c({type:"timeout",target:n})}),12e4);n.onerror=n.onload=c,document.head.appendChild(n)}return Promise.all(f)},b.m=e,b.c=d,b.d=function(e,f,a){b.o(e,f)||Object.defineProperty(e,f,{enumerable:!0,get:a})},b.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},b.t=function(e,f){if(1&f&&(e=b(e)),8&f)return e;if(4&f&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(b.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&f&&"string"!=typeof e)for(var d in e)b.d(a,d,function(f){return e[f]}.bind(null,d));return a},b.n=function(e){var f=e&&e.__esModule?function(){return e.default}:function(){return e};return b.d(f,"a",f),f},b.o=function(e,f){return Object.prototype.hasOwnProperty.call(e,f)},b.p="/SpotifyAPI-NET/",b.gca=function(e){return t(e={17896441:"9",35214713:"20",52804278:"25","031dc046":"4","0951e901":"5","10f76bbd":"6","15560a88":"7","16b2da92":"8","18116e9d":"10","1aaf601c":"11","1be78505":"12","1f220079":"13","22a09cbf":"14","25bfd71f":"15","266dfd57":"16","27d9d47d":"17","2851a227":"18","293befc8":"19","3abe8fb9":"21","3c5916b7":"22","3d0d8a2f":"23","516486bd":"24","6373637a":"26","67d5074e":"27","700347c0":"28","73139ff1":"29","755cfc2e":"30","8581bb41":"31","8ddd655f":"32","9008bace":"33","902b04f6":"34","92bb876c":"35","9ed00105":"36",a09c2993:"37",a1189d06:"38",ad407b76:"39",b5ab5f4e:"40",bbb8f1f8:"41",c4f5d8e4:"42",cd5a7ece:"43",d0e245df:"44",d85a39be:"45",dd053733:"46",e02badcb:"47",e06aacec:"48",e27d08ab:"49",e3c15a47:"50",e6afeee9:"51",e8057f2a:"52",fbd836ef:"53"}[e]||e)},b.oe=function(e){throw console.error(e),e};var n=window.webpackJsonp=window.webpackJsonp||[],o=n.push.bind(n);n.push=f,n=n.slice();for(var u=0;u<n.length;u++)f(n[u]);var i=o;a()}([]);
|
@ -1 +0,0 @@
|
|||||||
!function(e){function a(a){for(var f,b,t=a[0],n=a[1],o=a[2],u=0,l=[];u<t.length;u++)b=t[u],Object.prototype.hasOwnProperty.call(c,b)&&c[b]&&l.push(c[b][0]),c[b]=0;for(f in n)Object.prototype.hasOwnProperty.call(n,f)&&(e[f]=n[f]);for(i&&i(a);l.length;)l.shift()();return r.push.apply(r,o||[]),d()}function d(){for(var e,a=0;a<r.length;a++){for(var d=r[a],f=!0,b=1;b<d.length;b++){var n=d[b];0!==c[n]&&(f=!1)}f&&(r.splice(a--,1),e=t(t.s=d[0]))}return e}var f={},c={55:0},r=[];function b(e){return t.p+""+({4:"031dc046",5:"0951e901",6:"10f76bbd",7:"15560a88",8:"16b2da92",9:"17896441",10:"18116e9d",11:"1aaf601c",12:"1be78505",13:"1f220079",14:"22a09cbf",15:"25bfd71f",16:"266dfd57",17:"27d9d47d",18:"2851a227",19:"293befc8",20:"35214713",21:"3abe8fb9",22:"3c5916b7",23:"3d0d8a2f",24:"516486bd",25:"52804278",26:"6373637a",27:"67d5074e",28:"700347c0",29:"73139ff1",30:"755cfc2e",31:"8581bb41",32:"8ddd655f",33:"9008bace",34:"902b04f6",35:"92bb876c",36:"9ed00105",37:"a09c2993",38:"a1189d06",39:"ad407b76",40:"b5ab5f4e",41:"bbb8f1f8",42:"c4f5d8e4",43:"cd5a7ece",44:"d0e245df",45:"d85a39be",46:"dd053733",47:"e02badcb",48:"e06aacec",49:"e27d08ab",50:"e3c15a47",51:"e6afeee9",52:"e8057f2a",53:"fbd836ef"}[e]||e)+"."+{1:"d763968b",2:"c001a4a7",3:"c31fd0fb",4:"4bbde1c6",5:"cf855e8e",6:"42ec62d7",7:"87d09bef",8:"d2778896",9:"26bac051",10:"621d5ec0",11:"978cf109",12:"6d7d8bd2",13:"9ce06b90",14:"2f27e6ba",15:"7c17ac0d",16:"4ea9d864",17:"d1ff49b1",18:"4d72a6b0",19:"92cd91f1",20:"a90f533e",21:"0680d663",22:"6bb2d689",23:"44e5d4a3",24:"76e1e4c3",25:"fa0255b2",26:"fe9f6bca",27:"028abf76",28:"bf5c6ef8",29:"b763b5b4",30:"90dfe2db",31:"0ab7b88d",32:"7cbb4b5a",33:"3c3a0bc9",34:"be95bf0d",35:"939b6523",36:"3d8f9ac0",37:"f705eba9",38:"8e448121",39:"90023bdf",40:"db16314d",41:"a51b1be7",42:"993db86e",43:"4f84e5ce",44:"0349a107",45:"c5c9f2d2",46:"ce9658b5",47:"9743ac6d",48:"d96e0272",49:"73639153",50:"8a264025",51:"590700fa",52:"646077ab",53:"32cf0357",56:"c99bee3c"}[e]+".js"}function t(a){if(f[a])return f[a].exports;var d=f[a]={i:a,l:!1,exports:{}};return e[a].call(d.exports,d,d.exports,t),d.l=!0,d.exports}t.e=function(e){var a=[],d=c[e];if(0!==d)if(d)a.push(d[2]);else{var f=new Promise((function(a,f){d=c[e]=[a,f]}));a.push(d[2]=f);var r,n=document.createElement("script");n.charset="utf-8",n.timeout=120,t.nc&&n.setAttribute("nonce",t.nc),n.src=b(e);var o=new Error;r=function(a){n.onerror=n.onload=null,clearTimeout(u);var d=c[e];if(0!==d){if(d){var f=a&&("load"===a.type?"missing":a.type),r=a&&a.target&&a.target.src;o.message="Loading chunk "+e+" failed.\n("+f+": "+r+")",o.name="ChunkLoadError",o.type=f,o.request=r,d[1](o)}c[e]=void 0}};var u=setTimeout((function(){r({type:"timeout",target:n})}),12e4);n.onerror=n.onload=r,document.head.appendChild(n)}return Promise.all(a)},t.m=e,t.c=f,t.d=function(e,a,d){t.o(e,a)||Object.defineProperty(e,a,{enumerable:!0,get:d})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,a){if(1&a&&(e=t(e)),8&a)return e;if(4&a&&"object"==typeof e&&e&&e.__esModule)return e;var d=Object.create(null);if(t.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:e}),2&a&&"string"!=typeof e)for(var f in e)t.d(d,f,function(a){return e[a]}.bind(null,f));return d},t.n=function(e){var a=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(a,"a",a),a},t.o=function(e,a){return Object.prototype.hasOwnProperty.call(e,a)},t.p="/SpotifyAPI-NET/",t.gca=function(e){return b(e={17896441:"9",35214713:"20",52804278:"25","031dc046":"4","0951e901":"5","10f76bbd":"6","15560a88":"7","16b2da92":"8","18116e9d":"10","1aaf601c":"11","1be78505":"12","1f220079":"13","22a09cbf":"14","25bfd71f":"15","266dfd57":"16","27d9d47d":"17","2851a227":"18","293befc8":"19","3abe8fb9":"21","3c5916b7":"22","3d0d8a2f":"23","516486bd":"24","6373637a":"26","67d5074e":"27","700347c0":"28","73139ff1":"29","755cfc2e":"30","8581bb41":"31","8ddd655f":"32","9008bace":"33","902b04f6":"34","92bb876c":"35","9ed00105":"36",a09c2993:"37",a1189d06:"38",ad407b76:"39",b5ab5f4e:"40",bbb8f1f8:"41",c4f5d8e4:"42",cd5a7ece:"43",d0e245df:"44",d85a39be:"45",dd053733:"46",e02badcb:"47",e06aacec:"48",e27d08ab:"49",e3c15a47:"50",e6afeee9:"51",e8057f2a:"52",fbd836ef:"53"}[e]||e)},t.oe=function(e){throw console.error(e),e};var n=window.webpackJsonp=window.webpackJsonp||[],o=n.push.bind(n);n.push=a,n=n.slice();for(var u=0;u<n.length;u++)a(n[u]);var i=o;d()}([]);
|
|
Loading…
Reference in New Issue
Block a user