public async Task <ConnectedService?> GetConnectedServiceAsync( Guid id, [Service] IConnectedServiceManager serviceManager, CancellationToken cancellationToken) { ConnectedService?service = await serviceManager.GetServiceAsync( id, cancellationToken); return(service); }
public async Task ProcessTicketAsync(OAuthCreatingTicketContext ctx) { IConnectedServiceManager csm = ctx.HttpContext.RequestServices .GetRequiredService <IConnectedServiceManager>(); GitHubAuthContext autContext = ctx.HttpContext.RequestServices .GetRequiredService <GitHubAuthContext>(); ConnectedService?service = await csm.GetServiceAsync( autContext.Id, ctx.HttpContext.RequestAborted); ConnectedServiceProperty?accessToken = service.Properties .FirstOrDefault(x => x.Name == "AccessToken"); if (accessToken is { })