How can I add custom unique identifier to a user while connecting to opentok session? - opentok

I need to add a self created unique identifier when a user connecting to a session of a OpenTok. So when its connected I can retrieve it back against the connection object.
Is there a way I can do that?

Yes, you can include a 1Kb Data field for each connection, which can be retrieved by other connections in the session. This should not include any PII but be a tag for your app. You can also use the Connection ID in your own app data structures as a reference. See https://tokbox.com/developer/guides/create-token/

Related

Where to store the BigCommerce access token and other data

I am using laravel to build an app in BigCommerce. I am able to get access token but I need to store that for future requests. What is the best possible way to store the app data for BigCommerce?
I've got this working by creating a DB schema in Laravel where in there are tables like stores, users, app_settings.
Whenever the user installs an app, I am storing an access token and other information like store hash in stores table and user details in users table.
Whenever the app is loaded I could get the store and user information via verify signed request payload. Using this I am able to configure my app settings for the user and store those in app settings table.
So when I create a Webhook for the store, I could get the store hash from response as producer key and accordingly I can find the access token for the store using store hash in stores table.
If you're git ignoring your config.json or .env files, you could store these there. However after speaking with one of our Developer Advocates, I wanted to pass along some best practice advice. :) You may want to consider using a secrets manager for option #1 in your decision here. A secrets manager meaning a tool to safely store these variables like Secrets in Github or Key Vault in Azure.
Also, this resource may be helpful to review for your use case. https://www.codementor.io/#ccornutt/keeping-credentials-secure-in-php-kvcbrk55z

How do I provide a SignalR connection for a user in the database?

I do not use Asp.NET Membership. Instead, I have my own membership system. I keep my own user information in the database.
For example,
James Bond, UserID {AF433-DA322 ......-.........} Uniqueidentifier
I am creating a connectionID for SignalR or I want to define a member. How do I relate to user information in my own database?
The purpose is to send a message to the member in the database.
For example;
GUID userID = {AF433-DA322 .......-..........} [James Bond :)]
Clients.User(userID).send(message);
Anyhow, how do you establish a relationship between the user and the database? How can I promote it?
This can be achieved using a SignalR mapping table. This mapping table contains GUID userID and SignalR connection id at the moment.
Triggering an update or insert for above table (SignalR mapping table) should be followed by connection state changes in Client and server side.
Example .
Connected: Implement RegisterUser method in server side and call it
from Client side followed by SinglaR connected event.
Disconnected: Subscribe to the disconnected method in server-side and
do database table update according to your logic.
Now you can use above database table whenever you want to send a message to a user.

Update username on WSO2-IS with a JDBC user store

I'm using Identity Server 5.1.0 with a JDBC user store.
I have followed https://docs.wso2.com/display/IS510/Using+Email+Address+as+the+Username to allow the emails being the username.
I have a requirement to the change of the user's email address and i'm thinking either I can :
use some config to allow updating the username attribute
use other (mutable) attribute for authentication.
As of now im getting the follwoing exception for updating the user name attribute:
User name is immutable in carbon user store
How can i go about this?
Cheers,
Changing user name is not supported for JDBC user stores OOTB.
But you can write a custom user store manger to handle it. Make sure you change all the places when you do this operation, since some tables (Ex: IDN_USER_ACCOUNT_ASSOCIATION table) keeps user name as a key.
A working sample for this is available in [1] with the details. You can write a custom JDBC user store manager and get this done.
[1] http://tharindue.blogspot.com/2015/05/a-workaround-for-renaming-username-of.html

Parse.com - allow only one session per user

I have an App on Parse platform. What I need:
The User logs in on first device.
The User logs in on second device.
System revokes session on the first device.
I tried to remove objects from Session/Installation classes, but it did not help.
How can I do it?
Achieving this is not quite straightforward as there is no way to intercept login events or write cloud code triggers for Parse Session class. If you delete a client session record from the Session table, it should certainly revoke it and you end up getting authentication errors on that client. To achieve what you want, you need to write your own cloud function that logs a user in instead of using the SDK login function. That way you can first go through the Session table and revoke/delete any session associated with that user before logging in your user on the new device.

Accessing the value of a session variable of a specific session

I'm trying to integrate a public message board service into an existing web site.
The handshaking between the apps goes like this:
1) File on my web site loads a flash file. The Flash reads a local variable that is the Session ID, or some other GUID unique to the user session.
2) Flash app connects with the remote service, passing the SessionID to the service.
3) The service issues a GET request back to the originating web site, asking for additional information about the user.
4) The originating web site (my site) validates that the session ID is for a valid session, and if yes, passes back the other requested information.
I'd like to be able to use the intrinsic ASP SessionID but I'm not sure how in Classic ASP to retrieve session variables for a specific ASP Session, ie, I want the value of Session("FirstName") where SessionID=1234 and not Session("FirstName") for any other session ID. I haven't been able to find any syntax that would allow me to do this.
The alternative is to create a new GUID for every session, but that's adding a lot of overhead.
Any ideas?
I'm not aware of any way to retrieve Session details for a particular instance or ID.
However, you could utilise the Application object to store the information you need using the Session.SessionID value:
Application(Session.SessionID & tag) = myTagValue
This way you are not creating a new GUID, but utilising the already existing one for session that both client and server are using in your example.

Resources