User API or Account Management
Most internal organizations maintain their registered users
in a database. As an identity provider, this suffices to maintain the current
users However, different applications and services may need read only access to
the registered users, their id, name and email with or without the direct
access to the database. This is typically because the applications work with a
single database at any time not many databases at the same time. If the
database, happens to be different some form of dependency injection may be
required for the application to continue with the assumption that it can reach
the list of registered users.
Active Directory is a superset of all such users and is the
final authority for knowing if the user is a valid entity or not. To check if the registered user is still
current, we can defer to the AD. However, AD does not come with its own API
other than LDIF.
Companies often have API wrappers around the AD to
facilitate such function as creating and deleting groups. But users listing is
not necessarily provided by an API.
Therefore an API access to registered users should be no surprise and a way to facilitate the
addition or deletion of users may very well be required in certain cases.
It may even be helpful to separate out read-only access from
read-write access to this users list.
As an example,
class UserViewSet(generics.ListAPIView):
serializer_class = UserSerializer
queryset = User.objects.all()
APIs in service oriented architecture model are very useful for exporting such data to be used in different applications or services.
No comments:
Post a Comment