UserEmailAddressException while login in Liferay - liferay

I'm trying to log-in in the login page of Liferay but It's showing UserEmailAddressException while calling authenticateByEmailAddress method in LoginUtil class of portal-Impl.jar.
I'm also getting the following warning.
No Group exists with the key {companyId=10113, classNameId=10039, classPK=10116} liferay
Here classPk is UserId but everytime it's taking the same value of classPk i.e 10116 instead It should take the logged in person's UserId from USER_ table.
I tried to find the implementation(code) of authenticateByEmailAddress method in portal-Impl.jar but couldn't find it. I failed to find how it's getting classPk=10116 that's where problem lies.
String authResult = UserLocalServiceUtil.authenticateByEmailAddress(company.getCompanyId(), login, password, headerMap, parameterMap);
When all the valid parameters are passed in authenticateByEmailAddress method. It should return 1. i.e successful authentication but UserEmailAddressException exception is being thrown.

"No Group exists with the key" error will occur when there is no corresponding entry in the group_ table .
in Latest versions of liferay, after successful login, an entry will created in the group_ table.
in this case, it may be corrupted/deleted. please check that way.
Thanks

Related

set calculated property on model only once

im using python3 + django, and i have
a model of User with few fields
an admin page where all the users are presented
a form page where a single user is presented and can be updated
an external API with 2 endpoints:
GET /api/users/name (get all names for all the users)
GET /api/users/:id/name (get name for user by id)
i want to add a name property to be presented on admin page (as a column) and on a form page (read-only, not changeable)
how can i add this "calculated" property without calling an api more than needed?
it is normal function, you should create new method in ModelAdminand you can use result of this method in render.
more here:
https://docs.djangoproject.com/en/4.0/ref/contrib/admin/#django.contrib.admin.ModelAdmin.readonly_fields
if you want to get username as readonly in list and in form, add this method in list_display and in field or fieldsets Modeladmin options.
You don't need to use other api, if you has already users list.

Using Graph API to query SharePoint list items and expand user field

I'm trying to query for some SP list items, all is working fine except I can't seem to expand a custom column of type Person.
I can see the createdBy and lastModifiedBy expanded and even includes the AAD user id, which is great and also leads me to think what I want is possible!
But mine is a custom column.
I'm running this and can only seem to get the SP user list id and the user's display name...neither of which are much use.
/items?expand=fields(select=UserLookupId,User)
Ideally I'd like to get the AAD user id as per createdBy and modifiedBy field, but the email would suffice.
Otherwise the only way I can see is to query the User Information List (using the UserLookupId) to get the email?
Thanks
This appears to be correct assumption:
Otherwise the only way I can see is to query the User Information List
(using the UserLookupId) to get the email?
for non-system user fields, it is indeed a way to go, but there are some distinctions whether user field is multi-valued or single-valued.
If Approvers is a multi-valued user field, then the following query:
https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items?$expand=fields($select=Approvers)
returns email and id properties along with displayName property for user field value.
While for single-valued user field only id (available via {userfield}LookupId property) and displayName properties could be requested via items endpoint, for example:
https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items?$expand=fields($select=Approver,ApproverLookupId)
So, indeed User Information List needs to be utilized to request additional user properties, for example:
https://graph.microsoft.com/v1.0/sites/root/lists('User Information List')/items/{item-id}/?$expand=fields($select=Email)
where item-id corresponds to user field lookup id
This was my experience modifying the
Build Angular single-page apps with Microsoft Graph. In the examples below, I changed my id's out with the default text.
Here is
The Finished Project on thier github
In Graph Explorer, this worked. You can verify it at the Microsoft Graph Explorer.
https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items?expand=fields($select=id,Title)
In the app/graph.service.ts in the app, this did not work. Even though you would expect it to based on the graph explorer.
.api('/sites/{site-id}/lists/{list-id}/items?fields($select=id,Title)')
Changing the app/graph.service.ts api call worked.
.api('/sites/{site-id}/lists/{list-id}/items?')
.expand('fields($select=id,Title)')
The result looked like this:
fields: {
#odata.etag: ""d6f5b6ea-9f90-452d-98ba-e838f58d3359,1"",
Title: "IT SPECIALIST (MID)",
id: "20"
}
Here's an example site id:
some.sharepoint.com,9dk062b-2e54-4e4f-b71a-cdb74f42cc44,c6cf6b0a-cc7c-41fd-a76a-ef8f97e8a22f
Here's an example list id.
8eg8c29a-5555-4cfc-bfa4-0e907488f781
The end url won't have any {} in it.

(Nintex) Query User Profile returns missing values

Working in Nintex, I have a workflow that is kicked off when a form is saved. The workflow generates a PDF version of the Nintex form (we need actual signatures - digital in the future, fingers crossed). This is done by updating a word template, then converting to PDF.
When the word document is updated, the 'assigned to:' field is getting an AD account name instead of the user's First, Last name (which is expected). Now I'm trying to format it so it's more appropriate to the Hard Copy (in the Nintex form, it shows as Last, First).
I used a Query User Profile action, passed it the same variable I was using to hold the form's 'assigned to' value, and then used the drop down menu to choose the user profile variables I wanted (First, Last, also: username, account name, Distinguish name). All values are generating empty strings.
I've incrementally tried handing the values to variables that are of type String, Person, or Collection. I also handed it my username instead of the variable and set my account info for the login. I've always selected values, so I don't think it's a typo.
I'm at a loss... the workflow emails the user at the end, so it's getting the data. I hope that's enough info, I'm new to SP/Nintex so it could be a rookie mistake. Any help is appreciated.
Thank you!
I've seen issues where the User Profile Service properties have not been configured adequately, which leads to a lot of empty variables when running an LDAP Query action for AD attributes.
If this is the case, then one approach is to get the Farm admin (if you don't have access) to take a look at Manage User Profiles in Central Admin and see what AD attributes are mapped to the user profile. If mappings are changed you'll need to run a full sync to bring over the values. It can be inconsistent in my experience as well.

Security issue in CouchDb

I see one strange thing happening to CouchDb. When I go Futon page I see that I need to login. Otherwise, I will get an error message Error: anathorized if I try to change some view function. And when I login, this error goes away. So, this seems ok.
What is not ok is that when I try to invoke some view with curl without providing user and password, I do not get any error message, but get some result. I do it like this:
curl -XGET 'http://127.0.0.1:5984/db/_design/query/_view/delete/?key="object_1_"'
This view ^^^ is supposed to return a long list of data. In fact, 26 rows. And this is what I see in Futon when I'm logged in. But here as a result of curl command I get:
{"total_rows":26,"offset":25,"rows":[{"id":"...","key":"object_1_","value":"..."}]}
So, as you can see I get one row of data. I have several questions. Why does CouchDb enable to query itself without providing user and password, when they are required? And why does it return so strange result - total_rows = 26, but in fact there is only one single row.
PS. Ubuntu 15.04, CouchDb 1.6.0
EDIT
If I provide user and password like this:
curl 'http://user:password#....similar'
then I still get this strange result with one row of data.
You did not restrict the database to any admins, admin_roles, users or user_roles - so ANYBODY has access to that database. This is DEFAULT and stated in the documentationen.
Why your view does return "strange results" does depend on your view and query.

Issue while inserting the user in liferay

I have created a form which has basic user details and on clinking of the Save button I am inserting the user details in the "USER_" table by calling the UserLocalServiceUtil.addUser(....). Now the user is creating with out any issue. But I am not able to see some form field parameters in UserLocalServiceUtil.addUser(....) method like (Title, Gender and Date Of Birth). Now how can I save this values. Please give me some suggestions that how can I insert the following fields (Title, Gender and Date Of Birth) at the time of user creation.
Liferay uses com.liferay.portal.model.Contact entity to store the contact information.
Use com.liferay.portal.service.ContactLocalServiceUtil.addContact method to create the contact. Significant parametres:
userId - Id of the user that is creating the contact. You can use PortalUtil.getUser method to get the current user from a request.
className - "com.liferay.portal.model.User".
classPK - Id of the new user that the contact is created for.

Resources