title: SKCloudServiceController().requestUserToken Freezes on iOS 14.2
body: <p>I am trying to run the following function from SKCloudServiceController but for some reason every time it runs, the app just freezes. I have tested my developer token and it does work. I am running Xcode 12.2. Maybe there was an update which would make this not work anymore?</p>
  <p>I've tested the token and it works.</p>
  <pre><code>class AppleMusicAPI {
      let developerToken = &quot;b'eyJ0{...}RDlRSlFw'&quot;
  
      func getUserToken() -&gt; String {
          var userToken = String()
          let lock = DispatchSemaphore(value: 0)
          func requestAccess(_ completion: @escaping(String?) -&gt; Void) {
              SKCloudServiceController().requestUserToken(forDeveloperToken: developerToken) { (receivedToken, error) in
                  completion(receivedToken)
              }
          }
          requestAccess( { (completeToken) in
              if let token = completeToken {
                  userToken = token
                  lock.signal()
              }
          })
          lock.wait()
          return userToken
      }
  
      func fetchStorefrontID() -&gt; String {
          let lock = DispatchSemaphore(value: 0)
          var storefrontID: String!
          let musicURL = URL(string: &quot;https://api.music.apple.com/v1/me/storefront&quot;)!
          var musicRequest = URLRequest(url: musicURL)
          musicRequest.httpMethod = &quot;GET&quot;
          musicRequest.addValue(&quot;Bearer \(developerToken)&quot;, forHTTPHeaderField: &quot;Authorization&quot;)
          musicRequest.addValue(getUserToken(), forHTTPHeaderField: &quot;Music-User-Token&quot;)
          
          URLSession.shared.dataTask(with: musicRequest) { (data, response, error) in
              guard error == nil else { return }
              
              if let json = try? JSON(data: data!) {
                  let result = (json[&quot;data&quot;]).array!
                  let id = (result[0].dictionaryValue)[&quot;id&quot;]!
                  storefrontID = id.stringValue
                  lock.signal()
              }
          }.resume()
          
          lock.wait()
          return storefrontID
      }
      
      func searchAppleMusic(_ searchTerm: String!) -&gt; [Song] {
          let lock = DispatchSemaphore(value: 0)
          var songs = [Song]()
  
          let musicURL = URL(string: &quot;https://api.music.apple.com/v1/catalog/\(fetchStorefrontID())/search?term=\(searchTerm.replacingOccurrences(of: &quot; &quot;, with: &quot;+&quot;))&amp;types=songs&amp;limit=25&quot;)!
          var musicRequest = URLRequest(url: musicURL)
          musicRequest.httpMethod = &quot;GET&quot;
          musicRequest.addValue(&quot;Bearer \(developerToken)&quot;, forHTTPHeaderField: &quot;Authorization&quot;)
          musicRequest.addValue(getUserToken(), forHTTPHeaderField: &quot;Music-User-Token&quot;)
          
          URLSession.shared.dataTask(with: musicRequest) { (data, response, error) in
              guard error == nil else { return }
              if let json = try? JSON(data: data!) {
                  let result = (json[&quot;results&quot;][&quot;songs&quot;][&quot;data&quot;]).array!
                  for song in result {
                      let attributes = song[&quot;attributes&quot;]
                      let currentSong = Song(id: attributes[&quot;playParams&quot;][&quot;id&quot;].string!, name: attributes[&quot;name&quot;].string!, artistName: attributes[&quot;artistName&quot;].string!, artworkURL: attributes[&quot;artwork&quot;][&quot;url&quot;].string!)
                      songs.append(currentSong)
                  }
                  lock.signal()
              } else {
                  lock.signal()
              }
          }.resume()
          
          lock.wait()
          return songs
      }
  }
  </code></pre>