title: Generating Oauth authorization token using base64 encoding
body: <p>I am trying to follow the guide to generate Oauth authentication tokens for YAHOO DSP API.</p>
  
  <blockquote>
    <p>Base64 encoding is a way of encoding binary data into text so that it can be easily transmitted across a network without error.</p>
    
    <p>In this step, you will take the client ID and client secret that the YDN console generated for you and encode them using the base64 protocol. You can use an online encoding service like base64encode.org.</p>
    
    <p>No matter which service you use, ensure that no spaces are appended to the CLIENT_ID and CLIENT_SECRET keys and separate the CLIENT_ID and CLIENT_SECRET with a colon, i.e. CLIENT_ID:CLIENT_SECRET.</p>
    
    <p>The generated value will now be referenced as ENCODED(CLIENT_ID:CLIENT_SECRET) in this guide.</p>
  </blockquote>
  
  <p>An example is given:</p>
  
  <blockquote>
    <p>CLIENT_ID = dj0yJmk9N2pIazlsZk1iTzIxJmQ9WVdrOWVEUmpVMFpWTXpRbWNHbzlNQS0tJnM9Y29uc3VtZXJzZWNyZXQmeD00NA–</p>
    
    <p>CLIENT_SECRET= a7e13ea3740b933496d88755ff341bfb824805a6</p>
    
    <p>AUTHORIZATION = ZGoweUptazlOMnBJYXpsc1prMWlUekl4Sm1ROVdWZHJPV1ZFVW1wVk1GcFdUWHBSYldOSGJ6bE5RUzB0Sm5NOVkyOXVjM1Z0WlhKelpXTnlaWFFtZUQwME5BLS06YTdlMTNlYTM3NDBiOTMzNDk2ZDg4NzU1ZmYzNDFiZmI4MjQ4MDVhNg==</p>
  </blockquote>
  
  <p>Using the recommended website I get the wrong AUTHORIZATION.</p>
  
  <p>I have tried both encoding the whole thing at once ie. encode(CLIENT_ID:CLIENT_SECRET), and each element individually encode(CLIENT_ID):encode(CLIENT_SECRET). </p>
  
  <blockquote>
    <p>Attempt encoding whole thing:
    ZGoweUptazlOMnBJYXpsc1prMWlUekl4Sm1ROVdWZHJPV1ZFVW1wVk1GcFdUWHBSYldOSGJ6bE5RUzB0Sm5NOVkyOXVjM1Z0WlhKelpXTnlaWFFtZUQwME5B4oCTOiBhN2UxM2VhMzc0MGI5MzM0OTZkODg3NTVmZjM0MWJmYjgyNDgwNWE2</p>
    
    <p>Attempt encoding each element:
    ZGoweUptazlOMnBJYXpsc1prMWlUekl4Sm1ROVdWZHJPV1ZFVW1wVk1GcFdUWHBSYldOSGJ6bE5RUzB0Sm5NOVkyOXVjM1Z0WlhKelpXTnlaWFFtZUQwME5B4oCT:YTdlMTNlYTM3NDBiOTMzNDk2ZDg4NzU1ZmYzNDFiZmI4MjQ4MDVhNg==</p>
    
    <p>Expected result:
    ZGoweUptazlOMnBJYXpsc1prMWlUekl4Sm1ROVdWZHJPV1ZFVW1wVk1GcFdUWHBSYldOSGJ6bE5RUzB0Sm5NOVkyOXVjM1Z0WlhKelpXTnlaWFFtZUQwME5BLS06YTdlMTNlYTM3NDBiOTMzNDk2ZDg4NzU1ZmYzNDFiZmI4MjQ4MDVhNg==</p>
  </blockquote>
  
  <p>The difference between 'each element' and the expected result is only a few characters corresponding to the end of client_ID and the colon.
  B4oCT: should be BLS06.</p>
  
  <p>Links to full documentation:
  <a href="https://developer.yahoo.com/dsp/api/docs/authentication/tokens.html" rel="nofollow noreferrer">https://developer.yahoo.com/dsp/api/docs/authentication/tokens.html</a>
  <a href="https://developer.yahoo.com/dsp/api/docs/traffic/info/sandbox.html" rel="nofollow noreferrer">https://developer.yahoo.com/dsp/api/docs/traffic/info/sandbox.html</a></p>
  
  <p>Update:</p>
  
  <p>The final character of Client_ID is '–' . This is some sort of non-standard character that is interpreted as two dashes i.e.'--' in utf-8 and windows 1258.</p>