We need the ability to create new apps and then create client credentials within those from an API. Does anyone have any sort of direction we can take to make this as easy as possible without having to modify much of the source?
After looking more into the code and getting a better understanding of how it all works, I see what you mean with how I could attach the admin role.
Although I have a few questions:
Can you create client credentials outside of an application? Right now it seems all of the credentials you create have to be tied to an application and not a users account. If this is the case, it doesn’t solve the initial problem we have where we need to be able to create new applications through the API.
If we can create client credentials outside of an app, would we need to create a new client role? How is the client role interpreted upon request?
I just write a list of bullet points, because I am tired to think about how to structure my answer
Permissions are stored as claims and you can also assign them manually to an user. It is described in the docs 
When you create a role with permissions the user object gets enriched with these permissions in the request pipeline 
This means that the code does not care about where the permissions are coming from.
So you can just create a client and give this client the admin permissions.
I think you even do not have to give this client special permissions because every authenticated user or client should be able to create new apps, because you do not need any permissions. But honestly I have never tested it, but you can see it in the code 
So I have gotten the app creation to work, you can actually create apps from another apps client credentials just fine.
Now a point of discussion for which approach is more logical.
Authenticate as an actual identity user, we would need a way to get just the auth token from the login so we could pass it to our requests.
Authenticate through the client credentials generated under an app. This works fine but then the app isn’t associated to an actual user, but to client credentials. So the app doesn’t show in the UI and doesn’t have an association to a user. We could create an additional method to handle linking the app to a specified user if we wanted.
Approach 1 seems to make the most sense, I am trying to wrap my head around how the UI gets the auth token to begin with. The POST to login to the site just returns a redirect, how does the UI get all of the authentication info that is stored in the local storage?
If I can just get access to the auth token that is generated upon login, that’s all I would need to create apps without having to use the UI, but still have them linked to my user in case I wanted to.