-
Notifications
You must be signed in to change notification settings - Fork 19
Establishing Mixer credentials outside the Unreal Editor
Getting Started using C++ and Getting Started using Blueprints demonstrate the use of LoginSilently
to authenticate the current user to the Mixer service. This relies on the plugin's ability to access cached credentials.
In the Unreal Editor these come from signing in to Mixer as part of setting up your project. When using Xbox Live, the credentials come from the user's Xbox Live identity. But for desktop Win32 you must establish these credentials yourself.
The Mixer plugin provides a Slate control to assist with this, delivering the same web-based sign-in experience found in the Mixer Interactivity settings for the Unreal Editor.
For example, given a full-screen Slate widget (e.g. an existing menu), the following code will add a sign-in pane to the top-right corner:
TSharedPtr<const FUniqueNetId> NetId = nullptr; // Get net id for current user
ChildSlot // Existing menu root
[
SNew(SOverlay) // Existing SOverlay for menu content
// ...
+ SOverlay::Slot()
.HAlign(HAlign_Right)
.VAlign(VAlign_Top)
[
SNew(SMixerLoginPane)
.AllowSilentLogin(true)
.UserId(NetId)
]
// ...
];
The pane is displayed only when user login is required. Use of AllowSilentLogin
permits the pane to attempt to LoginSilently
before first display, so that in the case where cached credentials exist the UI is never shown. When using the platform Xbox Live identity for login the UI will never be displayed, but the AllowSilentLogin
will still be attempted provided a valid UserId
is bound.