IdentityManager / IdentityManager.AspNetIdentity

ASP.NET Identity support for Thinktecture IdentityManager
Apache License 2.0
60 stars 51 forks source link

How to access REST Api? #19

Closed johnfake closed 8 years ago

johnfake commented 9 years ago

Hi,

Configuration: IdentityServer v3

i'am running successfull the sample and i can manage my users per browser under https://localhost:44333/core/admin/#/.

But how can I retrieve all users per restapi via postman (GET) and of course POST new one?

thanks any help or hints!

Regards John

MichaelPetrinolis commented 9 years ago

Hi, AspNetIdentity is an implementation for the EF Identity DBContext. Please check the following files in core https://github.com/IdentityManager/IdentityManager/blob/master/source/Core/Api/Controllers/UserController.cs and https://github.com/IdentityManager/IdentityManager/blob/master/source/Core/Api/Controllers/RoleController.cs for users and roles api

brockallen commented 9 years ago

I've not fully tested/developed it, but there was always the idea to allow client apps to use the API directly (and not use the API). This requires the use of an OAuth2 AS to issue a token so the APIs can be used securely. Still a WIP.

BruceHunter commented 8 years ago

My solution was to create a new WebAPI endpoint Project that utilizes the IdentityManager classes and IdentityManager.AspNetIdentity. I'm actually sharing the same AspNetIdentityManagerService class that you create for the IdentityManager UI implementation. I created my own UserController calls -> (IdentityService calls -> AspNetIdentityManagerService, IdentityService calls -> UserService).

IdentityManager - endpoints are implmentented in a very specific way. I suggest you take my approach. I recently did 2 Pull Requests to expose a few methods not exposed by AspNetIdentityManagerService.

The WebAPI project utiliizes (IdentityServer3.AccessTokenValidation).

Each project and company will have different rules / procedures when creating users, managing roles, claims and permissions etc and thus why you should create your own endpoints to handle this functionality.

IdentityManager is a generic backdoor to the data. I feel it should stay very simple and basic.