Class UserPoolResourceServer
Defines a User Pool OAuth2.0 Resource Server.
public class UserPoolResourceServer : Resource, IUserPoolResourceServer, IResource, IConstruct, IConstruct, IDependable
- Inheritance
-
UserPoolResourceServer
- Implements
-
IResourceIConstructIConstructIDependable
Examples
var pool = new UserPool(this, "Pool");
var readOnlyScope = new ResourceServerScope(new ResourceServerScopeProps { ScopeName = "read", ScopeDescription = "Read-only access" });
var fullAccessScope = new ResourceServerScope(new ResourceServerScopeProps { ScopeName = "*", ScopeDescription = "Full access" });
var userServer = pool.AddResourceServer("ResourceServer", new UserPoolResourceServerOptions {
Identifier = "users",
Scopes = new [] { readOnlyScope, fullAccessScope }
});
var readOnlyClient = pool.AddClient("read-only-client", new UserPoolClientOptions {
// ...
OAuth = new OAuthSettings {
// ...
Scopes = new [] { OAuthScope.ResourceServer(userServer, readOnlyScope) }
}
});
var fullAccessClient = pool.AddClient("full-access-client", new UserPoolClientOptions {
// ...
OAuth = new OAuthSettings {
// ...
Scopes = new [] { OAuthScope.ResourceServer(userServer, fullAccessScope) }
}
});
Remarks
ExampleMetadata: infused
Constructors
UserPoolResourceServer(Construct, string, IUserPoolResourceServerProps)
public UserPoolResourceServer(Construct scope, string id, IUserPoolResourceServerProps props)
Parameters
scope
Constructid
stringprops
IUserPoolResourceServerProps
Properties
UserPoolResourceServerId
Resource server id.
public virtual string UserPoolResourceServerId { get; }
Property Value
Methods
FromUserPoolResourceServerId(Construct, string, string)
Import a user pool resource client given its id.
public static IUserPoolResourceServer FromUserPoolResourceServerId(Construct scope, string id, string userPoolResourceServerId)