Using AppAuth with IdentityServer4
Since IdentityServer4 is a certified OpenID Connect implementation and supports PKCE, there are no special steps needed to use it with AppAuth.
Sample IdentityServer client definition that works OOB with the AppAuth sample:
var client = new Client
{
ClientId = "native.code",
ClientName = "Native Client (Code with PKCE)",
RequireClientSecret = false,
RedirectUris = { "io.identityserver.demo:/oauthredirect" },
AllowedGrantTypes = GrantTypes.Code,
RequirePkce = true,
AllowedScopes = { "openid", "profile" },
AllowOfflineAccess = true
};
You can find a demo instance of IdentityServer4 at https://demo.identityserver.io. On the main page you can find a number of registered clients and their configuration (all clients can use arbitrary redirect URIs).
The following changes are required for the AppAuth sample:
// set the issuer
static NSString *const kIssuer = @"https://demo.identityserver.io";
// client ID for code flow + PKCE
static NSString *const kClientID =
@"native.code";
// some redirect URI (must match the plist setting)
static NSString *const kRedirectURI =
@"io.identityserver.demo:/oauthredirect";
The IdentityServer project has an issue tracker and documentation. Feel free to open an issue when you think you found a bug or unexpected behavior. There's also a pretty active community on StackOverflow that can help out with more general questions.