title: Where to store tokens in a xamarin.form application
body: <p>I have the class below that will be used in a xamarin.forms mobile application
  to retrieve the token generated by OAuth(webapi). Once this is generated I need to store
  in a place where I can access it again and not generating this all the time.
  Where is the best place to store this in the Pcl? I will also want to be able to remove this once
  the user logs off. </p>
  
  <pre><code>        class LoginService
          {
              public async Task Login(string username, string password)
              {
                  HttpWebRequest request = new HttpWebRequest(new Uri(String.Format("{0}Token", Constants.BaseAddress)));
                  request.Method = "POST";
  
                  string postString = String.Format("username={0}&amp;amp;password={1}&amp;amp;grant_type=password", 
                  HttpUtility.HtmlEncode(username), HttpUtility.HtmlEncode(password));
                  byte[] bytes = Encoding.UTF8.GetBytes(postString);
                  using (Stream requestStream = await request.GetRequestStreamAsync())
                  {
                      requestStream.Write(bytes, 0, bytes.Length);
                  }
  
                  try
                  {
                      HttpWebResponse httpResponse =  (HttpWebResponse)(await request.GetResponseAsync());
                      string json;
                      using (Stream responseStream = httpResponse.GetResponseStream())
                      {
                          json = new StreamReader(responseStream).ReadToEnd();
                      }
                      TokenResponseModel tokenResponse = JsonConvert.DeserializeObject(json);
                      return tokenResponse.AccessToken;
                  }
                  catch (Exception ex)
                  {
                      throw new SecurityException("Bad credentials", ex);
                  }
              }
          }
  </code></pre>