Jump to content

Login changes


Luke

Recommended Posts

There are some very minor changes to accommodate new features. It's all documented here but I'll go over the changes:

 

https://github.com/MediaBrowser/MediaBr ... entication

 

- User.Configuration has two new properties - IsDisabled, IsHidden. Clients do not need to pay any attention to them.

 

- ServerConfiguration has a new property - ManualLoginClients - it's a list. Possible values are Mobile, MediaBrowserTheater, Roku. Roku is in the back end but I left it out of the dashboard unless Grant wants to implement this.

 

- I've added a couple new api endpoints

 

- /Users/Public and

- /Users/{Name}/AuthenticateByName - if successful, returns a result object with the User so you can grab the Id.

 

Instructions:

 

1. Change your initial users call from /Users to /Users/Public. This represents the users that can be displayed publicly. You can also get this via /Users using filtering, but this gives us a blanket for the future because I anticipate we'll have more settings down the road.

 

2. Also before showing the login screen, make a call to /Server/Configuration. Examine the ManualLoginClients property.

 

3. Only display the users visually if at least one public user is returned, and configuration.ManualLoginClients does not have an entry pertaining to your client. Current values are Mobile, MediaBrowserTheater, and Roku.

 

4. If desired, clients are free to completely forego a visible user list and simply present a traditional login form. In this case, none of the above api calls will be necessary.

 

 

MBC & ROKU

 

You guys can ignore all of this if you want but at the very least please make the change to /users/public.

 

Everyone else should do a full implementation.

Link to comment
Share on other sites

Also, disabling users - this will cause 403 Forbidden response error codes. You need to have a catch-all for any api call that your application makes that can handle these errors and bounce the user back to the login screen.

Link to comment
Share on other sites

Also - no existing functionality is broken, so take your time.

Link to comment
Share on other sites

skynet600

Maybe not Luke. MBC does not start-up for me now. I get a full splash screen of MB3 coming towards me then it just sits there. Initially I thought it was the new crystal dll but I deleted that and still nothing.

Link to comment
Share on other sites

Maybe not Luke. MBC does not start-up for me now. I get a full splash screen of MB3 coming towards me then it just sits there. Initially I thought it was the new crystal dll but I deleted that and still nothing.

 

This part of the forum isn't the place for bugs, so let's not create noise here. But as you know these issues can't be diagnosed without logs so until I see one there is nothing i can do.

Link to comment
Share on other sites

gcw07

I guess the question for me is, do you think the Roku should implement this fully? I can make the switch to "Users/Public" fairly easily, but is the URL the only difference? Wouldn't it only return public users or does it do the check to see what client is calling it then determine what to return? To me, it seems silly for an in home client to bother with the full thing, but I will do whatever you guys want it to do and feel is appropriate for the client.

Link to comment
Share on other sites

I actually agree with you, so I'm going to remove Roku from the back-end options and we'll just wait and see if it gets requested.

 

You should switch to the public users url, although fyi, it's not in the dev build that just went out, so you'll have to wait.

 

The only other thing you should handle is the forbidden response code that could happen at anytime.

 

One consideration though - if the admin hides all users then a traditional login form should be used. That I meant by zero public users coming back. However, I'd rather your dev time be spent elsewhere so I'm fine with waiting and seeinf if anyone actually does that.

Link to comment
Share on other sites

skynet600
Maybe not Luke. MBC does not start-up for me now. I get a full splash screen of MB3 coming towards me then it just sits there. Initially I thought it was the new crystal dll but I deleted that and still nothing.

 

This part of the forum isn't the place for bugs, so let's not create noise here. But as you know these issues can't be diagnosed without logs so until I see one there is nothing i can do.

So this is a bug? I was simply providing feedback on a change that may well have caused this problem. Of course I am likelly to be way off the mark. In any event point taken so log etc posted on CT in the MBC thread. I will keep my "noice" to a minimum in future.

Link to comment
Share on other sites

Maybe not Luke. MBC does not start-up for me now. I get a full splash screen of MB3 coming towards me then it just sits there. Initially I thought it was the new crystal dll but I deleted that and still nothing.

 

This part of the forum isn't the place for bugs, so let's not create noise here. But as you know these issues can't be diagnosed without logs so until I see one there is nothing i can do.

So this is a bug? I was simply providing feedback on a change that may well have caused this problem. Of course I am likelly to be way off the mark. In any event point taken so log etc posted on CT in the MBC thread. I will keep my "noice" to a minimum in future.

 

Sorry, I expected developer questions in that thread so I didn't want them to get mixed with defects. I will gladly take a look at the log once posted.

Link to comment
Share on other sites

Redshirt

Is this in the wild yet? Swagger doesn't show the /Users/Public endpoint and manually typing it results in an error saying "Unable to bind request". I'm running server 3.0.4937

Link to comment
Share on other sites

the public users enpoint will be in the next dev build but the current one has everything else you need.

Link to comment
Share on other sites

When will all of this be going into the wild as at least beta?

 

I have other changes I want to release to MBC and don't want to be tied to these changes if they aren't out there yet.

Link to comment
Share on other sites

If you really need it, it can be anytime. Otherwise I'm hoping to drop down to once a week server releases just so it's a little less hectic.

Link to comment
Share on other sites

I don't really need it. I just want to know when to put these things in. I'll leave them out for now. Thx.

Link to comment
Share on other sites

  • 3 weeks later...

Minor change, but if you are using the new AuthenticateByName endpoint, for the next build you'll have to move the user name out of the path and into the body (along with the password).

 

So instead of

 

/Users/{Username}/AuthenticateByName

 

It will be

 

/Users/AuthenticateByName

 

It's possible the web client is the only one using it so you might not be affected.

Link to comment
Share on other sites

ScottIsAFool

I take it this doesn't affect me other than what you've already said (using name instead of id)

Link to comment
Share on other sites

I take it this doesn't affect me other than what you've already said (using name instead of id)

 

Well, it does. First you should use GetPublicUsers instead of GetUsers.

 

Then the core has a setting that allows the admin to require a manual login screen for mobile clients. Yours should respect that and just show a traditional username/password login. If you want to just do that all the time to make it easier, that's fine too.

Link to comment
Share on other sites

Also, you should test disabling a user while it's logged into the phone. your http requests will start failing. so make sure you can handle that and bounce the user back to the login page.

 

There's an event on apiclient - HttpResponseReceived. You can use that as a global hook for all calls if you want.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...