adamkaz
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2017
10:22 PM
GetChannelCred
I was wondering if anyone has been able to get GetChannelCred working as intended. It looks like it would be a pretty slick way to authenticate users. Its a bit hard to debug, since I'm guessing that it only works for channels in the store (private or public). Even so, when I've played around with it, I seem to always get an empty json object back.
Here is what I'm trying:
When I POST this to my server, pucid == "none"
Here is what I'm trying:
store = CreateObject("roChannelStore")
channelcredjson = store.GetChannelCred().json
pucid = "none"
if channelcredjson <> invalid and channelcredjson <> ""
channelcredobj = ParseJSON(channelcredjson)
if channelcredobj<>invalid and channelcredobj.roku_pucid<>invalid
pucid = channelcredobj.roku_pucid
end if
end if
When I POST this to my server, pucid == "none"
3 REPLIES 3
renojim
Community Streaming Expert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2017
01:06 AM
Re: GetChannelCred
It works for me with a private channel, but returns an empty JSON object when sideloaded. Although the docs claim it's of type "JSON", it's really just roString. I didn't bother parsing the JSON object; I just dumped the string. It looks ok to me.
-JT
-JT
Roku Community Streaming Expert
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.
adamkaz
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2017
07:21 AM
Re: GetChannelCred
JT - thanks for the reply. Mind giving us an example of what that roString looks like? Does it have curly braces, etc? (replace some letters/numbers so you don't give away YOUR channelcred 🙂 )
renojim
Community Streaming Expert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2017
12:00 PM
Re: GetChannelCred
{"error":null,"roku_pucid":"eb0a2d4b-0bad-59fe-aae3-25ccfcbf5fbf","token_type":"urn:roku:pucid:token_type:pucid_token"}
This is interesting and I don't know what it means, but when I ran my test channel on my Roku 4 I got back an empty string. The same channel on my Roku 3 or TV returns something similar to the above. Make sure you check the value of status. I've only ever seen two values: 0 when it works and 400 when I get the empty string. 400 is also the value of status I get when sideloaded.
Hope this helps!
-JT
Roku Community Streaming Expert
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.