title: How to get token after login into keycloak with python-keycloak
body: <p>I am using <strong>flask</strong> to build app and <strong>keycloak</strong> for authorization.</p>
  <pre><code>from flask import Flask, session, request
  from keycloak import KeycloakOpenID
  
  app = Flask(__name__)
  app.secret_key = 's_k'
  
  
  keycloak_open_id =  KeycloakOpenID(server_url=&quot;http://localhost:8080/auth/&quot;,
                          client_id=&quot;Centrum&quot;,
                          realm_name=&quot;myrealm&quot;,
                          client_secret_key=&quot;c_k&quot;)
  
  def login_required(func):
      @wraps(func)
      def decorated(*args, **kwargs):
  
      // validate token
  
          return func('2', *args, **kwargs)
      return decorated
  
  
  @app.route('/login')
  def login():
      url = keycloak_open_id.auth_url('http://localhost:5555/auth')
  
      # how to get a token and assign it to session['token']?
  
      return redirect(url, code=302)
  
  @app.route('/home')
  @login_required
  def home():
      return 'Base URL!'
  </code></pre>
  <p>When I am logged in and can go to /home, but without token the application always needs to go through keycloak's method. Is there any other posibility to get token other than making own login form and pass login and password into <em>keycloak_open_id.token(login, password)</em> method?</p>