IBM MFP 8.0 multiple userID stick to 1 devices when use UserAuthenticationSecurityCheck - ibm-mobilefirst

We are using the IBM MFP 8.0 with the UserAuthenticationSecurityCheck.
We implement the createUser method as intruction:
#Override
protected AuthenticatedUser createUser() {
AuthenticatedUser user = new AuthenticatedUser(userId, userId, getName());
return user;
}
But, during the time we login logout with a lots of userId, I found out that multiple userIds are sticked to the device:
Please see the screenshot here
And the problem is when we register the device with the notification and push to the userId, it will put to the wrong one.
Anyone has experiences for this case please help?
Thanks

After investigate, I believe that each time I uninstall the app and re-install again, pass the login step and it will create one more mapping userId - deviceId in the Devices page on MFP Application Console.
Is there anyone faced this issue?

Related

Logout from other devices in Laravel

I have a laravel system that has four different guards. I am intended to log out from all other devices if a user login from a new device or every login. I want to destroy all other previous sessions. I have tried all the suggestions found on the internet. Can anyone help me out with this issue?
if(Auth::guard('super_admin')->attempt($validated_data)) {
Auth::guard('super_admin')->logoutOtherDevices($validated_data['password']);
$request->session()->regenerate();
return redirect()->route('super_admin_dashboard')->withSuccess('Login as Super Admin is Successful');
}
I have tried something like this. It works fine for login and changes the hash password in the database. But it remains logged on other devices.

Discord.Net Refresh user role

So, I'm working on Discord.Net and want to get if user has certain role
I wrote this code:
public bool IsAlreadyHasAffiliation(SocketGuildUser user)
{
IReadOnlyCollection<SocketRole> roles = user.Roles;
foreach(SocketRole role in roles)
{
if (SpecifiedRoles.ContainsValue(role.Id)) return true;
}
return false;
}
It works fine but has some problem: Don't get the role that added by bot after bot started.
For example after I added "Role1" via bot and execute above function, it work like user don't have Role1.
How can I get live update of role in bot?
If you're noticing strange behaviour in relation to users, which you are, then it's most likely down to the recent Privileged Intents update. Discord.NET caches (downloads) users and uses events such as GuildUserUpdated to keep this cache up to date in the background. Without the Guild Members intent Discord.NET can not keep its user cache up to date, causing problems such as this.
To fix the problem enable the Guild Members privileged intent on the Bot tab of your bot's page on the Discord developer's portal.
If that doesn't work then use the nightly versions of Discord.NET and specify all of the intents that you need in the DiscordSocketConfig. To use the nightly versions, add https://www.myget.org/F/discord-net/api/v3/index.json as a package source on NuGet package manager.
Here's a DiscordSocketConfig which specifies gateway intents (only available on nightly):
new DiscordSocketConfig
{
GatewayIntents =
GatewayIntents.Guilds |
GatewayIntents.GuildMembers |
GatewayIntents.GuildMessageReactions |
GatewayIntents.GuildMessages |
GatewayIntents.GuildVoiceStates,
...
});

Getting all messages from Microsoft Teams

I'm trying to get all the messages from Microsoft Teams in my tenant, I have registered the application to Azure, set the correct permissions and grated admin privileges.
What I am getting confused about is creating a GraphServiceClient.
My app is more of an Daemon Application.
I would really appreciate if someone could give me an example of how to create the client correctly.
this is my code so far:
string[] graphScopes = { "https://graph.microsoft.com/.default" };
IConfidentialClientApplication app = ConfidentialClientApplicationBuilder
.Create("x")
.WithTenantId("x")
.WithClientSecret("x")
.Build();
ClientCredentialProvider authProvider = new ClientCredentialProvider(app);
GraphServiceClient graphClient = new GraphServiceClient(authProvider);
try
{
var messages = await graphClient.Teams["x"].Channels["x#thread.skype"].Messages.Request().GetAsync();
Console.ReadLine();
foreach(var item in messages)
{
Console.WriteLine(item.Body);
}
}
catch(Exception e)
{
Console.WriteLine(e.Message);
Console.Read();
}
I'm getting the following error no matter what I'm trying to get
Code: UnknownError Inner error: AdditionalData: request-id: x date: 2020-05-27T14:22:37 ClientRequestId:x
update: I was able to get something from the API, I had wrong permissions.
still can't get the messages though,
I have all these permission:
ChannelMessage.Read.All, Group.Read.All, Group.ReadWrite.All
I'm probably missing the "ChannelMessage.Read.Group (RSC)" permission but I can't find it in the permissions page.
May this is the solution or the problem ;-)
Microsoft Teams APIs in Microsoft Graph that access sensitive data are considered protected APIs. These APIs require that you have additional validation, beyond permissions and consent, before you can use them.
https://learn.microsoft.com/en-us/graph/teams-protected-apis
Your problem is you are accessing a "beta" api but using the production base url path.
The permission you need is ANY of the following (i.e. or not and):
ChannelMessage.Read.Group (RSC) OR
ChannelMessage.Read.All OR
Group.Read.All OR
Group.ReadWrite.All
Since you have Group.Read.All, that is ALL you need for permissions.
What you need to do is change the base URL to the beta api:
graphClient.BaseUrl = "https://graph.microsoft.com/beta";
UPDATED:
Since now you are saying that you are getting a "Forbidden" error, I think you also have a consent problem.
My guess is that you created & consented you app on one tenant but you are trying to access the data in another tenant. This will give you a forbidden errors. i.e. you created and consented on a dev azure account tenant and are trying to access your work tenant.
If this is the situation you need to:
* Make sure that the setup you azure app to be multi-tenanted
* You have to get your app consented by the target tenant
If you do that and use the beta endpoint I would expect that your example code will start working.
Update2:
Finally got around to trying to do the message list with a application context like you above and I get the same Forbidden error as well from the beta api. From a user context it works fine. So your answer will be to use a user context and not an application context to access this API.
It looks like what you are hitting is a Protected API. So if you want to use this API from an application context, you will have to submit a request to be allowed access to it.

Restrict quickblox user creation

When a user registers at my website I also need to create a quickblox user. I got this procedure to work:
Get a session token from API route "api.quickblox.com/session.json". But to do so I need a user. So I use my own login to quickblox dashboard.
Create the user by hitting API route "/users.json". Fair eanough, it works!
Questions
It feels strange using my own dashboard login as the token generator account. Is there not some other way?
The newly created user can create more users! That is, I created a new token with the details from the just created user, whom in turn was allowed to create further users. This cant be right? What am I doing wrong?
Quickblox chat example available here: http://quickblox.github.io/quickblox-javascript-sdk/samples/chat/# serves the keys and secret in the open, like this:
QBApp = { appId: 46126, authKey: 'Nyc2fwgg8QeFJpS', authSecret: SUv3grsaDMx5'}; Is that the way to do it? Then atleast I would like to control the creation of new users..
Thanks!
Hope you doing well !!
For Quickblox must have manage session for each and every users,you have to download and integrate quickblox SDK into your web app.
You have to follow this steps:
1) Create a app on Quickblox and add credentials into your javascript SDK or configure your javascript SDK.
2) Whenever user is logged-in to you app you must have to login quickblox as well and get session for logged-in user.
3) Do whatever operation with user created session like (chat,viedo call, audio call)
4) When user log-out from your, you have to manage like user also logout form quickblox and destroy previously created sessions.
5) When registering new user you have to also register that user into your quickblox app.
this way you have to manage user management.
hope this will help you.
To create a user with an arbetary session/token this function can be used (for JS SDK)
var params = {login: 'test3', password: '12345678'};
function createUser(params) {
QB.createSession(function(err, result) {
QB.users.create(params, function(err, user) {
if (user) {
// user - JS obejct with QB user
alert("successfully created a user!");
} else {
alert("error!");
}
});
});
}
"The newly created user can create more users!"
After further research I have concuded this is a part of the design and not to worry about. I will add a job to clean up any users created by spammers.

MobileServiceClient LoginAsync returns wrong userId

I am using the MobileServiceClient.LoginAsync function to login with a Microsoft- and Facebook account in my Xamarin.Forms app. I came across an issue where the loginAsync returns the wrong userId the second time I login:
Lets say my facebook userId is: facebook:11111 and my Microsoft userId is: microsoft:22222. If I login with facebook first, the correct userId is returned. If I login with Microsoft after that, the following userId is returned: microsoft:11111 (instead of microsoft:22222). The same happens when I first login with the Microsoft account, the second time I log in with facebook, the facebook userId is facebook:22222 instead of facebook:11111. I use the following code to login:
var client = new MobileServiceClient(applicationUrl, applicationKey);
client.LoginAsync(provider);
I have also tried to logout first before logging in but has no effect. Am I missing something or is this a bug in the MobileServiceClient?
Apparently this is a known server bug in Mobile Services with a .NET backend: more info