How can I add users in ApostropheCMS? - authentication

I'm using ApostropheCMS. I want to add users authentication to my project. How can I do this? The users should be created in the same way I created admin user? (via /login page and apostrophe-users module).
I want to create a custom form for both login and registration. Then I want to check if the user is log in and if so, I want an user profile for them.

There's a module you can install to add a signup form: https://github.com/apostrophecms/apostrophe-signup

Related

Newly added users are not showing up For GSuite

I am using the GSuite Admin SDK, Directory API (https://developers.google.com/admin-sdk/directory/v1/guides/manage-users) to add and list users,
After adding a new user (using this endpoint: https://www.googleapis.com/admin/directory/v1/users) I try and check if that user exists in the user list or not (using this endpoint: https://www.googleapis.com/admin/directory/v1/users?customer=my_customer).
Every time I do these steps I could not find the newly created users, there seems to be a problem with synchronization.
Is there any solution for this without changing the access token?
thnx for the help.

What is the proper way of registering new user using IdentityServer4 with multiple clients?

I am building 2 MVC applications and will be using IdentityServer as a single sign-on authentication provider. By following the sample code from IdentityServer web site, I can get the authentication working. But now I am confused about how to register new users in the MVC applications.
For example in MVC 1, I have a secured controller action. Now accessing this action will be redirected to IdentityServer login page. If user selected an external login provider and login successfully, then the user will be redirected to the "Register" page of IdentityServer to ask whether the user wants to register. If user clicks "Register", then redirected to the secured action successfully. So far the sample code has done all these. But my question is that MVC1 & MVC2 need some more information about the user for registration. How can I prompt user to input these additional information? It is not feasible to have these information inputted in the IdentityServer register page because MVC 1 & 2 need different information. But if I have a register page in MVC1 & MVC2, then how can I force user to complete the registration? After user is authenticated from IdentityServer, he is returned directly to the originally requested Url. I just can't have code in every controller action to verify whether an authenticated user have completed the detailed registration.
An ideal way is that once a user is authenticated from IdentityServer, I can check whether this user has been registered in the local MVC user database. If not, then redirect the user to the local MVC register page and then back to the originally requested Url. How this can be done or is there a more appropriate way for doing this?
But my question is that MVC1 & MVC2 need some more information about
the user for registration.
To retrieve additional user info, you could depend on user claims for the additional user information. Otherwise, there is an endpoint called UserInfo Endpoint
But if I have a register page in MVC1 & MVC2, then how can I force
user to complete the registration?
Based on client_id you could change the registration view
I just can't have code in every controller action to verify whether an
authenticated user have completed the detailed registration.
You could create a customize filter to validate that. But, I would say try to keep the user related details on IdS4 project
I can check whether this user has been registered in the local MVC
user database. If not, then redirect the user to the local MVC
register page and then back to the originally requested Url. How this
can be done or is there a more appropriate way for doing this?
If you think, these user information will only be used for this client then you could take this approach.
However, if possible you asked for all the required details on the user registration page, no harms keeping the information for mvc1 users. But sometimes it is not possible (e.g. internal vs external users). If it is for internal users, then I guess it would be better to have a seperate Admin UI where user can add extra information.
Anyway, if you want to keep everything in one user registration page on Id server, i would add an extra flag on Client table which will indicate to show extra fileds. Hope this may help you.

How to restrict access to Jenkins?

My Jenkins instance is currently open for every user, there is no authentication. I want to protect Jenkins against access by unauthorized users. I'm looking for a very simple/basic solution -- one user. If this "admin" user hasn't authenticated himself, he should not be able to do anything. If he has, he should get the full access the Jenkins instance (including all projects). How to configure this?
Follow these steps:
Go to Configure Global Security --> Security Realm : Jenkin's own user database and authorization Logged-in users can do anything. After saving, Jenkins should prompt you to create a new user. Please create the required user by filling in details like username and password.
Then, log in with that user and change the authorization to Matrix-based security. The matrix configuration should be as shown below i.e., it should have all privileges for the required user and none for anonymous users.
First you need to create an admin user or whatever you want.
To do that, go to your jenkins dashboard page and find "Credentials" option.
In credentials, you can create your user.
With your admin user created, just go back to your jenkins dashboard page and find "Manage Jenkins" option, in there, click on "Configure Global Security".
In Global Security Page, check the box "Enable Security", scroll down to "Access Control" and chose "Jenkins’ own user database" and select what users can do after login.

Openam Approve Access Right Requests

Do we have something out of the box in OpenAM like the following: Assume you have UserA, he wants to access page A, makes a request for that, some admin users approves the request, before finally system admin gives access to the user. And user is able to access the page after the system admin operation. Is that possible? Or do we need to build something custom for that?
You need to build a custom extension for this

Laravel 5.2 Authentication for admin and user

I'd like to make authentication for admin and user using the laravel 5.2 auth api, I've a users table in which I've define ENUM type role field for user and admin so I need to use only table but different views and routes for admin and user login.
I've successfully create a user auth by using following command.
php artisan make:auth
but I can't understand how to implement auth for admin.
before you answer keep in mind there is only one users table which have role field and different views for admin and user login. After successfully login user will redirect to home page and admin should redirect to admin/dashboard.
Thanks
You Can use https://github.com/romanbican/roles package ...
if ($user->is('admin')) { // you can pass an id or slug
// or alternatively $user->hasRole('admin')
}