Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.
SOLVED

Creating rooms with External Authentication

Avatar

Former Community Member

My application works like this:each user has their own room, and I need to allow them to publish and subscribe, but not own (and thus not create sub rooms). So they login to my site, get an auth token from LCCS, and then create a ConnectSession with this auth token. But unless I getAuthenticationToken with owner priveleges 100, it fails with

insufficient permissions to create a new CollectionNode. You must be an OWNER of the room to add new multi-user features to it. Log in with developer credentials in order to do so.

So what I need to know is how to

A) create a room for the user using external authentication

B) allow the user to log in to that room with publisher priveleges after having gotten an auth token.

C) allow other users to log in to that room with publisher priveleges after recieving the same auth token.

Any help greatly appreciated, and code samples please!


1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Hi There,

That's definitely not expected. Let's ignore any aspects of authentication

here, and just assume you're always coming in as a PUBLISHER, since this

should be able to work.

I just went through the workflow using the Room Console, and was able to

get this working. A couple of checkpoints :

1) Can you log into the templateroom room in the Room Console, and verify on

the explore tab that it has a CollectionNode set up for chat? (it will be

named "xxx_SimpleChat")

2) Am I reading this right, that you've named the new template

"templateroom" as well? Maybe try naming it "templateapp" instead?

3) Once you've created templateapp in the Room Console, trying adding a new

room to it via the Console (the "add" button in the Rooms column). Log into

the new room you've just created, and check its explore tab - does it come

with the collectionNode you saw in your template room?

I'm sure we'll find some explanation - thanks for hanging in there!

nigel

View solution in original post

7 Replies

Avatar

Former Community Member

Hi there,

Check out the developer guide pdf, specifically section 6.3, on creating

templates of your room. The process is roughly :

1) With your dev credentials, build a room in the normal way, setting up the

features you need.

2) Save that room as a template, either from the Dev Portal or Room Console.

3) Each time you spawn a new room, do so from your template (there's a

templateName parameter in the server APIs), and the room will come

pre-furnished with whatever multi-user features you set up. No need for your

users to come in as owners.

nigel

Avatar

Former Community Member

Hi Nigel,

I knew I could count on you . What I am really interested in is 1); I was unable find any documentation on how to configure this room template (other than naming it). In afcs.acrobat.com when I create a new room, it doesn't give me any room options, and the REST API doesn't seem to have any ways to configure a room. Is this done in AS3? In the ReST API samples? On the server? Thanks again!

Avatar

Former Community Member

Hi there,

The real idea is that you just configure a room in Flash (Flex) Builder

using your dev credentials. Add a chat, a whiteboard, whatever else you

need. Compile and run - LCCS lets you do this, since you're logged in as an

OWNER. That room now has the features set up so that future users can use

them (but only the ones you've set up!). So, take that room (it should be in

the dev portal) and say "apply this as an application template". You can

build a new app this way, or apply this room's features to an existing app.

From that point on, when you create a new room in that application (whether

in the portal or through the Server APIs), it comes pre-configured with the

ability to host the same features you added in Flex Builder. If you need to

re-configure a template, just set up the components in Flex Builder again

(you can use the Room Console in the SDK Navigator to get a look at what's

been installed in your room), and apply that room to the application's

template again - it just overwrites the old one.

For more on this, check the Templates Video Tutorial in the dev portal.

hope that helps!

nigel

Avatar

Former Community Member

So I tried everything in the video, still not getting what I want.

In the afcs console I start out with

[ apps ]   [ rooms ]

default    templateroom

I use the FlashSimpleChat to connect to template room with my owner creds. In the trace it says "SAVED! <YourApp>" after i set template room as a new Application.

Now I have

[ apps ]   [ rooms ]

default    templateroom

templateroom

So I log in to my app, and the server side code calls account.createRoom("somenewname","templateroom"). After this user's room is created, the app swf needs an authToken, so I generate one server side getAuthenticationToken("somenewname",username,username,50) send it down.

The swf uses the authtoken to get a session, connects fine, I see FMS traces, etc. Role is 50. Then I get the SAME OWNER ERROR. This is not expected. I don't want user's to be owners of their room. However if I getAuthenticationToken("somenewname",username,username,100) and use that auth token, the connection works, no owner error! I've tried every? permutation of this cycle to the same effect. User's can only have externally authenticated rooms with chat and video if they are owners. So it seems that templating is pointless. What am I not understanding here? Thanks alot again!

Avatar

Correct answer by
Former Community Member

Hi There,

That's definitely not expected. Let's ignore any aspects of authentication

here, and just assume you're always coming in as a PUBLISHER, since this

should be able to work.

I just went through the workflow using the Room Console, and was able to

get this working. A couple of checkpoints :

1) Can you log into the templateroom room in the Room Console, and verify on

the explore tab that it has a CollectionNode set up for chat? (it will be

named "xxx_SimpleChat")

2) Am I reading this right, that you've named the new template

"templateroom" as well? Maybe try naming it "templateapp" instead?

3) Once you've created templateapp in the Room Console, trying adding a new

room to it via the Console (the "add" button in the Rooms column). Log into

the new room you've just created, and check its explore tab - does it come

with the collectionNode you saw in your template room?

I'm sure we'll find some explanation - thanks for hanging in there!

nigel

Avatar

Employee

reading yours and nigel posts I think you didn't recreate your room, maybe assuming that a room with the same name as the template will inherit the template configuration.

Templates are like a "static" configuration file used only to create new rooms. If you make changes to the template (not that you can, right now) existing rooms will NOT change their configuration. You will have to delete and recreate your rooms in order to get the new template values.

Avatar

Former Community Member

Awesome I believe it is fixed. The error turned out to be in the collection node name, I believe, as I was setting a different name in the actual swf. Although it also could have been the fact that the Application was the same name as the Room.

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----