sonos-controller | Java API for controlling SONOS players | Audio Utils library

 by   vmichalak Java Version: v.0.1 License: MIT

kandi X-RAY | sonos-controller Summary

kandi X-RAY | sonos-controller Summary

sonos-controller is a Java library typically used in Audio, Audio Utils applications. sonos-controller has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has low support. You can download it from GitHub.

Java API for controlling SONOS players
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              sonos-controller has a low active ecosystem.
              It has 41 star(s) with 9 fork(s). There are 13 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 13 open issues and 11 have been closed. On average issues are closed in 51 days. There are 1 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of sonos-controller is v.0.1

            kandi-Quality Quality

              sonos-controller has 0 bugs and 0 code smells.

            kandi-Security Security

              sonos-controller has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              sonos-controller code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              sonos-controller is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              sonos-controller releases are available to install and integrate.
              Build file is available. You can build the component from source.
              Installation instructions are not available. Examples and code snippets are available.
              sonos-controller saves you 727 person hours of effort in developing the same functionality from scratch.
              It has 1679 lines of code, 186 functions and 21 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed sonos-controller and discovered the below as its top functions. This is intended to give you an instant insight into sonos-controller implemented functionality, and help decide if they suit your requirements.
            • Clips the current music
            • Get the current track information
            • Pauses the current instance
            • Get the play state of the device
            • Gets a queue of tracks from the server
            • Creates a new content directory
            • Find all occurrences of a given regular expression
            • Parses track metadata
            • Sets the play mode for the queue
            • Get the bass value
            • Turns the night mode
            • Mute or unmute the sound
            • Changes the led state
            • Returns the play mode of the queue
            • Returns the treble s treble
            • Play a single item from a queue
            • Get all SONOS devices on the network
            • Returns true if soundness is activated
            • Change the speaker s input
            • Discover a single SONOS speaker
            • Sets the bass value
            • Switch to line input
            • Returns true if the speaker is a group coordinator or not
            • Get the current volume
            • Remove a track from a queue
            • Set the treble value
            Get all kandi verified functions for this library.

            sonos-controller Key Features

            No Key Features are available at this moment for sonos-controller.

            sonos-controller Examples and Code Snippets

            sonos-controller,How to clone the project
            Javadot img1Lines of Code : 4dot img1License : Permissive (MIT)
            copy iconCopy
            git clone https://github.com/vmichalak/sonos-controller.git
            cd sonos-controller
            git submodule init
            git submodule update
              
            sonos-controller,Basic Usage
            Javadot img2Lines of Code : 3dot img2License : Permissive (MIT)
            copy iconCopy
            List devices = SonosDiscovery.discover();
            
            SonosDevice sonos = new SonosDevice("10.0.0.102");
            sonos.pause();
              

            Community Discussions

            QUESTION

            SONOS auth token is not being sent in Authorization HTTP header for CQ API calls
            Asked 2021-May-21 at 23:00

            I followed the Sonos docs for adding app authentication and the page for using authentication tokens and the result is that the SMAPI server correctly returns an authToken together with a privateKey back to the controller. I can see the authToken being present in the credentials header inside the SOAP messages sent to my SMAPI server.

            However, despite the many mentions of this inside the Sonos docs pages related to HTTP requests (I will list the resources links down below), the same authToken is not being sent inside the HTTP header Authorization, this making my CQ server unable to validate requester identity.

            I tried the following, without success:

            • checking "Requires authorization header" capability in the customsd page of my Sonos device (I tried this because the docs page about capabilities precisely indicates that checking this "Sends OAuth token in the HTTP Authorization header.")

            • identifying some correlation between the "X-Sonos-" prefix HTTP headers used when the controller sends SOAP messages to my SMAPI server and the "X-Sonos-" prefix HTTP headers used when the device sends HTTP requests to my CQ server (eventually, I could not find any information that would identify the user based on this)

            From Sonos device:

            X-Sonos-Playback-Id: RINCON_48??????D201400:3165321802 <= deviceId inserted after RINCON_

            X-Sonos-Device-Id: Sonos_U????????????????????????6 <= householdId

            X-Sonos-Corr-Id: 267e3e0c-75ca-4b9d-8be4-b8a795a462a3 <= unique each time

            From macOS Controller:

            X-Sonos-Controller-ID: 68:??:??:??:??:07 <= the same each time

            X-Sonos-Api-Key: 8??????e-7??7-4??f-b??6-7??????????0 <= the same each time

            X-Sonos-Corr-Id: 648ec896-e043-44f8-bfba-cd0a80c9d857 <= unique each time

            The docs links I mentioned above that refer the presence of the auth token inside the HTTP Authorization header are the following:

            • the GET /context CQ API method page says to return 401 Unauthorized when "The access token has expired or is invalid."

            • the GET /itemWindows CQ API method page says "the player can use this API to obtain a new access token in the response from your cloud queue server" and "The request contains the access token in the authorization header" and "If the access token is set to expire soon, an updated one is included in the X-Updated-Authorization header of the response"

            • the POST /timePlayed CQ API method page says "The request header contains the access token in the authorization header" and that the method returns ERROR_SONOS_TOKEN_EXPIRED when "SMAPI OAuth token is expired, and user must re-authorize the account"

            • the GET /version CQ API method page says again that "The request contains the access token in the authorization header" and talks about a now deprecated updateToken parameter and also says that "If the access token is set to expire soon, you should include an updated token in the X-Updated-Authorization header."

            But the most clear mention is in the page about HTTP requests, because it's not particular just for the CQ API endpoints but for all HTTP endpoints, even those hosted by the SMAPI server itself. The page reads the following 2 excerpts:

            and

            To conclude, with so many mentions of it in the official Sonos docs, why isn't this essential header being transmitted in the HTTP Authorization header? And how should a CQ verify the identity of the requester without the presence of this authToken on each API method request?

            ...

            ANSWER

            Answered 2021-May-09 at 22:26

            If I follow you correctly, the token is passed in the header under loginToken, see https://developer.sonos.com/build/content-service-add-features/add-authentication/use-authentication-tokens/

            This is not an http header, this is a section of the SOAP envelope. Like this:

            Source https://stackoverflow.com/questions/67316704

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install sonos-controller

            You can download it from GitHub.
            You can use sonos-controller like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the sonos-controller component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/vmichalak/sonos-controller.git

          • CLI

            gh repo clone vmichalak/sonos-controller

          • sshUrl

            git@github.com:vmichalak/sonos-controller.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Audio Utils Libraries

            howler.js

            by goldfire

            fingerprintjs

            by fingerprintjs

            Tone.js

            by Tonejs

            AudioKit

            by AudioKit

            sonic-pi

            by sonic-pi-net

            Try Top Libraries by vmichalak

            ssdp-client

            by vmichalakJava

            Hermes.Net

            by vmichalakC#

            steam-store-parser-js

            by vmichalakJavaScript

            unsplash-downloader

            by vmichalakJavaScript

            Unity-NetChecker

            by vmichalakC#