Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I am trying to get a list of YouTube-videos using the Skybrud Social 1.0.1 package for Umbraco. Right now I am getting an "insufficient permission"-error even trying to list channels of a user. I think that I might need to specify a permission scope in code. Maybe something like this?
var scope = new Skybrud.Social.Google.OAuth.GoogleScopeCollection();
This is my code so far
var rootNode = Model.Content.AncestorOrSelf(1);
var oAuth = rootNode.GetPropertyValue<GoogleOAuthData>("googleOauth");
if (oAuth != null && oAuth.IsValid)
GoogleService googleService = oAuth.GetService();
var channelOptions = new Skybrud.Social.Google.YouTube.Options.YouTubeChannelListOptions()
Username = "xxx"
var response = googleService.YouTube.Channels.GetChannels(channelOptions);
If we look at Skybrud.Social for Umbraco 7 and Skybrud.Social as two separate packages, Skybrud.Social is shortly described the mapping to various APIs as well as logic for authentication, while Skybrud.Social for Umbraco 7 is an integration between Umbraco and a portion of Skybrud.Social.
Skybrud.Social for Umbraco 7 has a property editor (the one you're using) that's lets you authenticate with Google, but this property will only request basic Google scopes, and therefore not any scopes for YouTube. So you will have to implement your own authentication page. I'm a little behind on the documentation for this part, so you can use this class for inspiration: https://github.com/abjerner/Skybrud.Social.Umbraco/blob/master/src/Skybrud.Social.Umbraco/App_Plugins/Skybrud.Social/Dialogs/GoogleOAuth.aspx.cs the scope is specified around line 125 ;)
With the proper scope (like YouTubeScopes.Readonly from your example), you should be able to execute your second example ;)
Turns out read-only access to videos in a channel was all I needed. Because of this I ended up fetching the YouTube channel feed as JSON using the API-key approach. Keeping it simple :-)
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted