title: Can OpenID Connect in IdentityServer4 Request Tokens from Client rather than generate internally?
body: <p>I am trying to better understand the OpenID Connect protocol with IdentityServer4, and am unclear on where I can find the answer to this question.</p>
  
  <p>I like the idea of the Identity Server providing a Bearer Token at the end of authentication that includes claims on who the user is, and what resources they can access.  However, I am a little uncomfortable in storing what Resources a user may have access to within the Identity Server environment.  I would like this Authorization piece to be authored at my client application.  Is there any type of callback in the OpenID callback that allows IdentityServer to call the client and request Authorization Claims from the client directly, rather than piece it together directly?</p>
  
  <p>As an example, I am working on a product that will require a user to log in using either Windows Authentication, Username/Password, or a Google Account.</p>
  
  <p>This client application will be hosted in a cloud environment, and will be hosted in the same domain as the Active Directory Server.<br>
  My thought was to create an Identity Server solution that is hosted internally, and to create a Client application that is hosted in the cloud.</p>
  
  <p>When the user logs into the Client application, they would be redirected to the Identity Server to log in.  The Identity Server would be hosted in the same domain as the Active Directory Server, so if there were Windows Credentials we could log them in automatically.  Otherwise, there will be a login screen where they can enter a Username/Password, log in with Google, etc.  </p>
  
  <p>Once the user has logged in, the Identity Server would return a Bearer Token (a JWT probably), that has their claim information.</p>
  
  <p>I can foresee this one Identity Server being used by many different Client application, because it would intrinsically allow Windows Authentication.  For this reason, I am hesitant to store all of the API Resources the user can access within the Identity Server itself.  My fear is that if I add a new permission to my client application (like a Report Admin claim), I would need to modify the Identity Server to include that new claim.  And if 4 or 5 clients all use this Identity Server, this could get to be a bit onerous.</p>
  
  <p>Instead, I would like to structure Identity Server so that when a user logs in for a particular client, Identity Server will make a callback request to the Client Application asking for the Claims that apply to that user.  That way, the Client Application knows and cares about the User/Claim mappings, not the Identity Server.  If I need to add a new Claim, I can do that within the Client application.  If I need to map a user to a Claim, I can do that on the Client application.  I don't need to do this on the Identity Server.</p>
  
  <p>Is this functionality that already exists?  If so, what do I need to be looking for?  From what I can tell, it appears that the mapping between the User and the Resources they have access to all occur on the Identity Server.</p>
  
  <p>The guide I am following is this: <a href="http://docs.identityserver.io/en/release/quickstarts/1_client_credentials.html#defining-the-api" rel="nofollow noreferrer">http://docs.identityserver.io/en/release/quickstarts/1_client_credentials.html#defining-the-api</a></p>
  
  <p>Thank you for any guidance.</p>