OpenAM Aunthentication and Authorization to web application - openam

I have one web application. I've successfully authenticated the users using OpenAM. For that i deployed and configured OpenAM on one Tomcate(8080) and my web application is deployed on another tomcate(8081).I have configured 'J2EE_AGENT' on tomcate(8081).
I am using OpenDJ for data store. I have created two users/group
user1 ----> group1
user2 ----> group2
I've created Agent and Policies on OpenAM. The configuration for Policies is as follows.
Resource Name which i wanted to protect is : http://example.com:8081/SpringMVC/welcome and allowed for GET and POST action. And assigned the group1 to this rule.
When i am trying to access protected URL, it gets successfully authenticated using OpenAM and able to access the link. But unfortunately group2 is also able to access the url though i didn't assgin that group to that rule.
My question comes over here
How i can configure the rule so that group2 can not access that url or group2 get access denied for that URL.
I've spent around 1 day on this. Early help would be appreciated.

Quick idea, under the agent config -> Global settings -> Agent Filter Mode, have you used SSO_only mode? This bypasses all authorization rules and allowed everyone that is authenticated.
If not I would recommend turning on the debug logs for the agent and the OpenAM. Set agent config -> Global settings -> Agent Debug Level to message and OpenAM main page -> configuration -> system -> logging -> logging level to INFO.
You can ind authorization decisions here /openam/debug/Policy

Related

Azure conditional access by device name

I want to limit access to Azure P2S VPN by computername. What I did:
I configure one conditional policy to block all users(Pol1).
Second conditional policy(Pol2):
All Users
In Cloud apps or actions I selected Azure VPN
Conditions - Filter for devices - Include filtered devices in policy
displayName contains MyComputerName
deviceID equals MyDeviceID (I got it using dsrgcmd /status)
Access controls -Grant access - Require multifactor authentication
When I am trying to connect with Azure VPN I see in Sign-in logs Pol1 failed. (Block access for all). Pol2 is Not Applied. Why? I specified to check out for Name or ID...
Next step instead of second policy I created a policy that Grant only for following:
Require multifactor authentication
Require domain-joined device
It doesn't work. I joined my computer to Azure AD - doesn't help. I still getting:
Not satisfied
Require multifactor authentication
Require domain-joined device
I am out of ideas... Any help will be appreciated!
I tried to reproduce the same in my environment and I got the results like below:
I have configured point to site vpn and connected successfully like below:
To Set MFA make sure. To set User assignment required as Yes to limit sign-in to only users that have permissions to the Azure VPN like below.
Enterprise application --> Azure VPN --> properties --> User assignment required. -> save
I have created group, added a limited member to access
In conditional access policy ->Assignments -> Users and groups -> include -> Add group like below
In Grant Require multi-factor authentication
In the Enable policy section -> click ON -> Create
Now when I try to connect with added group member it connected successfully.
When I try to access with another user it restricts like below
Reference:
Azure AD Authentication for Point to Site (P2S) VPN - Cloudthat | CloudThat
Update
I tried in my environment According to your scenario i have created policy 1.
Try to give block access for all user and in condition -> Filter& device -> exclude filtered device and provide your device id like below:
In policy 2, Now I have given Grant access for all user and you can Add device id and display name in include filtered device and grant access like below.

Azure Data Factory Linked Service for Salesforce (API Access in Salesforce Problem)

I'm trying to connect to Salesforce using a linked service on Azure Data Factory, But I get the following error (connection failed):
ERROR [HY000] [Microsoft][Salesforce] (80) Unknown error received from SOAP response, potentially a problem with user privileges.
I have followed the steps mentioned on the following link (Microsoft Documentation), to Enable API Access in Salesforce Classic by the Permission Set, but I couldn't find the permission name: API enabled.
https://learn.microsoft.com/en-us/azure/data-factory/connector-salesforce
https://migration.trujay.com/help/enable-api-access-salesforce-permission-set/
So I have assigned many permissions and I have added 15 settings randomly (as you will see on the picture below):
Added Setting
Can you please orientate me on which settings & permissions should I add.
Regards,
Setup -> Profiles -> (profile name) -> System permissions
Or Setup -> Permission Sets -> (name) -> System permissions and then "Manage Assignments", make sure it's added to your integration user.
If you don't see the checkbox it's possible API access isn't possible in your org . As that blog mentions - there are some cheaper license options like Group Edition, Contact Edition that allow only the website & mobile app use, no API.
Setup -> Company Information, in right column you should see "Organization Edition"

Keycloak: Role based client log-in access restriction for users

I am trying to achieve fairly simple usecase of role based client application (VueJS multi-page applications) control using the keycloak.
As shown in image, I have three different roles and three different clients in single realm.
The arrow in the image represents which role can access which client.
So my main objectives are,
User with role Viewer should only be able to log-in to the Viewer Application. If the same user tries to access the Operator Application or Admin application then keycloak should simply deny this user from doing so.
The same rules should follow for users with Admin and Operator role. Users of Admin role should be able to log-in to any of these application by keycloak.
To achieve this usecase I tried following ways,
First by appropriate role mapping to users and role creation in the clients. In this case, I create realm level roles and then client level roles, then assigned appropriate roles to the users created in the user section.
Enabling the Authorization. In the policies, I removed default policy that grant all users access to the client. And create a User policy and Client policy to restrict the access to client application
Also tried with Group based authorization policy. In this case, I created a group with client role and then assigned user to these groups. And enabled them from the Authorization group policy.
But, unfortunately none of this works. Meaning my user with Viewer role can log-in to my admin application. Which is just strange.
You can do this without extensions.
Copy the desired flow (e.g. the browser flow)
Create a new sub flow (e.g. for the browser forms) and call it Access By Role and select generic as type.
For the new sub flow ensure that CONDITIONAL is selected in the flow overview.
For the new sub flow add execution Condition - User Role, make it REQUIRED and configure it:
alias: admin-role-missing
role: admin (or whatever your role is)
negate: true
Add another execution: Deny Access and make it REQUIRED as well.
The final result should look similar to this:
This will deny access if the condition "admin-role-missing" is true.
You an also learn more from the docs: explicitly-deny-allow-access-in-conditional-flows
Also, don't forget to go to your client and select the flow in the authentication overrides.
The solution proposed by #Stuck is a great start, but it has a significant flaw: When the user has already authenticated, e.g. via the standard flow of another client that did not require the role, the password form flow will never be triggered. Consequently, the user will be logged in via the cookie flow without ever checking for the role.
In other words: If there are other clients (such as the account console) that do not require the role, anyone can bypass the role check.
To fix this there needs to be an additional flow layer that includes all authentication executions, that is followed by the authorization step (no matter what authentication flow was used). The final result will look like this:
I managed almost the same problem using KeyCloak extension SPI. After the deployment you will have additional configurable "execution" in authentication flows available, named "Validate User Role".
The auth flow then look's like :
This execution must be placed after the "Username Password Form" (or other form which authenticates user) or the authentication will fail.
The source code is here :
https://github.com/ValentinChirikov/kc_user_role_validate_extension
Finally handled this at the application level as it wasn't working from keycloak end.
After the login, check for the keycloak object, inspecting on the same we can find some of the useful properties set during the configuration mentioned in the question above. The overall code looks like below,
let appName = 'your_app';
keycloak.init({ onLoad: 'login-required' }).success(function () {
// Confirm the role & authentication of the user
if (keycloak.authenticated && keycloak.tokenParsed.resource_access &&
keycloak.tokenParsed.resource_access.hasOwnProperty(appName)) {
// Continue with the app execution...
} else {
// Logout user
keycloak.logout();
}
}).error(function () {
keycloak.logout();
});
This way I managed to route unauthorized user out of the application.
The solution isn't what's required in the question asked, but it works. Although I think this should be handled at the keycloak level itself.
For anyone looking to do this in Keycloak version 20, see the screenshot. This is based on answer by #heilerich but for version 20.
NOTE: Create a new flow instead of duplicating an existing flow as it will not work.

After disassociating user profile service application from web application, not able to edit user properties

Initially we did not had user profile service application configured for the web application and we were able to update the user properties as shown in below image
After configuring user profile service application and associating web application we were getting redirected to user profile to update the user information.
For some reason we dint wanted to use user profile for this web application and we created a new service application proxy group which does not include user profile service application and associated this group to our web application.
And now when we try to edit user profile we only get Default request property to update but not other properties, as shown in below image
Wanted to understand why is this behavior happening and how to configure so that we get option to update all the other properties of user(we don’t want to associate user profile service application)
#mallialways You can try following things.
Go in CA -> Application Management -> Manage service application -> User profile service application -> People - > Manage user properties
Edit one of the property, Lets say First name, Using the dropdown click on edit option.
On the EditProperty.aspx page, Please check two options,
Edit Settings -> Check - Allow users to edit values for this property
Display Settings -> Check - Show on the Edit Details page & Show in the profile properties section of the user's profile page
You wil have to repeat this step for every property which you want to edit.
I hope it helps :)

Add user to DefaultAppPool that isn't within IIS_WPG Group

My issue is two-fold:
Need a user account to write to inetpub/wwwroot that isn't in the IIS_WPG Group
Change the DefaultAppPool account to specified user account in #1
We cannot have anonymous HTTP writing to Server A from Server B from the default anon user account Windows reads from, hence for #2. And due to said server permissions, we cannot have Group IIS_WPG do any writing to inetpub/wwwroot either.
I created a new user account, but it isn't associated to any groups. Then, I added this user to the DefaultAppPool Identity instead of using Network Service. Then, under Inetpub/wwwroot I gave read/write permissions to this user account. Then I restart w3svc.
I am getting a Service Unavailable error now when I try to view any web page with this error in the logs: A failure was encountered while launching the process serving application pool 'DefaultAppPool'. The application pool has been disabled.
Note: I am not a Windows admin by any means, so what I'm doing is based off of any articles I can find and trusting their accuracy 100%.
The whole point of the IIS_WPG group is to have a pre-set grouping of the permissions required to run an application pool. So the best case is going to be creating your new user but then just adding that user to the IIS_WPG group.
If you can't do that, then I believe you have to explicitly give your new user the same permission set that IIS_WPG has already. Which can be found here: http://support.microsoft.com/kb/812614

Resources