title: How to get state and client_id from OauthService - Angular
body: <p>I have an app in Angular, which using OAuthService. I need to create logout url with redirect, assign it to variable <code>redirect_url</code>, and execute this code in my component:</p>
  <pre><code>window.location.href = this.redirect_url
  </code></pre>
  <p>Url (before encode) looks like:</p>
  <p><a href="https://example-app.com/logout?service=https://example-app.com/oauth2.0/authorize?response_type=token&amp;client_id=xxxxxx&amp;state=yyyyyy&amp;redirect_uri=https://example-app.com/someComponent?code=123&amp;scope=read" rel="nofollow noreferrer">https://example-app.com/logout?service=https://example-app.com/oauth2.0/authorize?response_type=token&amp;client_id=xxxxxx&amp;state=yyyyyy&amp;redirect_uri=https://example-app.com/someComponent?code=123&amp;scope=read</a></p>
  <p>I don't know how to get state and redirect_uri.</p>
  <p>I looked at the auth service code in the angular-oauth2-oidc.umd.js file and found that state is generated in the <code>TryLogin()</code> method. I also see that the login url is being created in the <code>cleateLoginUrl()</code> method. I don't know how I can get state and <code>client_id</code> to pass this to the newly created url. Is there any method on this site that I can use?</p>
  <p>Case: logout user, show the login window with url redirection. After login, the user will be redirected to <code>redirect_uri</code>.</p>