AutoWeb Can't seem to get SONOS API set up in AutoWeb

Discussion in 'AutoApps' started by taweko, Oct 3, 2019.

  1. taweko

    taweko New Member

    Joined:
    Oct 3, 2019
    Messages:
    2
    Likes Received:
    0
    Hello,

    I have been trying to set up the SONOS API with AutoWeb, but keep getting this error no matter what I try:
    [​IMG]

    Does it have something to do with the way SONOS requires the headers to be sent?
    [​IMG]
    https://developer.sonos.com/reference/authorization-api/refresh-token/

    ...or did I mess something up in my settings? (see attached images)
    I am pretty new to OAuth in general, so I apologize if this has a simple solution that I can't see.
    Any help would be appreciated!

    20191002_234820.jpg Screenshot_20191002-234613_AutoWeb.jpg
     
  2. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    I think for that you need to use the authentication type UserPass and then use the Client ID as username and client secret as Password.
     
  3. taweko

    taweko New Member

    Joined:
    Oct 3, 2019
    Messages:
    2
    Likes Received:
    0
    After changing the authentication type as you suggested, I didn't receive any sort of prompt to sign in or re-authenticate, so I continued to try and set up the API actions for the endpoint "households" as described here: https://developer.sonos.com/reference/control-api/households/
    With these settings:
    Screenshot_20191003-153230_AutoWeb.jpg
    ...but received this error:
    Screenshot_20191003-153156_AutoWeb.jpg


    I'm still suspecting problems with authentication... When I was using the OAuth with Refresh setting, I could get past the login prompt with SONOS and be redirected back to the joaoapps URI to press the check-mark, but would be given the "error authenticating" notification that I originally encountered once I pressed the "X". I noticed, for whatever reason, that if I put the word "Authentication" into the query parameter field, it wouldn't ask me to login at the SONOS portal anymore (I would still have to agree), but would still end up with the same "error authenticating". Whereas, if I left the query parameter field blank, I would have to login to SONOS every time I attempted to authenticate.

    I was wondering if maybe SONOS is doing something non-standard so I have been scouring this article: https://developer.sonos.com/build/direct-control/authorize/
    Could it maybe be because SONOS is expecting the entire "client_id:client_secret" string to be encoded and used as a single value, as opposed to encoding each separately and using both?
     
  4. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Yeah, that's how AutoWeb does it when you use the authentication method I mentioned. Does it show an authentication related error somewhere?
     
: autoweb, sonos

Share This Page