<div class="bs-sidebar col-sm-3 " data-ng-include data-src="resourceUrl + '/partials/realm-menu.html'"></div>
    <div id="content-area" class="col-sm-9" role="main" data-ng-init="initProvider()">
        <data-kc-navigation data-kc-current="social" data-kc-realm="realm.realm" data-kc-social="realm.social"></data-kc-navigation>
        <h2></h2>
        <div id="content">
            <ol class="breadcrumb">
                <li><a href="#/realms/{{realm.realm}}/identity-provider-settings">Social Providers</a></li>
                <li class="active">{{identityProvider.alias}} Settings</li>
            </ol>
            <h2 class="pull-left">{{identityProvider.alias}} Provider Settings</h2>
            <p class="subtitle"><span class="required">*</span> Required fields</p>
            <form class="form-horizontal" name="realmForm" novalidate>
                <fieldset>
                    <div class="form-group clearfix">
                        <label class="col-sm-2 control-label" for="redirectUri">Redirect URI</label>
                        <div class="col-sm-8">
                            <input class="form-control" id="redirectUri" type="text" value="{{callbackUrl}}{{identityProvider.alias}}/endpoint" readonly kc-select-action="click">
                        </div>
                        <span tooltip-placement="right" tooltip="The redirect uri to use when configuring the identity provider" class="fa fa-info-circle"></span>
                    </div>
                </fieldset>
                <fieldset>
                    <div class="form-group clearfix">
                        <label class="col-sm-2 control-label" for="clientId">Client ID <span class="required">*</span></label>
                        <div class="col-sm-4">
                            <input class="form-control" id="clientId" type="text" ng-model="identityProvider.config.clientId" required>
                        </div>
                        <span tooltip-placement="right" tooltip="The client identifier registered withing the identity provider." class="fa fa-info-circle"></span>
                    </div>
                    <div class="form-group clearfix">
                        <label class="col-sm-2 control-label" for="clientSecret">Client Secret <span class="required">*</span></label>
                        <div class="col-sm-4">
                            <input class="form-control" id="clientSecret" type="password" ng-model="identityProvider.config.clientSecret" ng-show="hidePassword" required>
                            <input class="form-control" id="clientSecret" type="text" ng-model="identityProvider.config.clientSecret" ng-show="!hidePassword" required>
                            <a href="" ng-click="showPassword(false)" class="link" ng-show="hidePassword">Show Secret</a>
                            <a href="" ng-click="showPassword(true);" ng-show="!hidePassword">Hide Secret</a>
                        </div>
                        <span tooltip-placement="right" tooltip="The client secret registered withing the identity provider." class="fa fa-info-circle"></span>
                    </div>
                    <div data-ng-include data-src="resourceUrl + '/partials/realm-identity-provider-' + identityProvider.providerId + '-ext.html'"></div>
                    <div class="form-group clearfix">
                        <label class="col-sm-2 control-label" for="defaultScope">Default Scopes </label>
                        <div class="col-sm-4">
                            <input class="form-control" id="defaultScope" type="text" ng-model="identityProvider.config.defaultScope">
                        </div>
                        <span tooltip-placement="right" tooltip="The scopes to be sent when asking for authorization. See documentation for possible values, separator and default value'." class="fa fa-info-circle"></span>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="enabled">Store Tokens</label>
                        <div class="col-sm-4">
                            <input ng-model="identityProvider.storeToken" id="storeToken" onoffswitch />
                        </div>
                        <span tooltip-placement="right" tooltip="Enable/disable if tokens must be stored after authenticating users." class="fa fa-info-circle"></span>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="storedTokensReadable">Stored Tokens Readable</label>
                        <div class="col-sm-4">
                            <input ng-model="identityProvider.addReadTokenRoleOnCreate" id="storedTokensReadable" onoffswitch />
                        </div>
                        <span tooltip-placement="right" tooltip="Enable/disable new users can read any stored tokens.  This assigns the broker.READ_TOKEN role." class="fa fa-info-circle"></span>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="enabled">Enabled</label>
                        <div class="col-sm-4">
                            <input ng-model="identityProvider.enabled" id="enabled" onoffswitch />
                        </div>
                        <span tooltip-placement="right" tooltip="Enable/disable this identity provider." class="fa fa-info-circle"></span>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="updateProfileFirstLogin">Update Profile on First Login</label>
                        <div class="col-sm-4">
                            <input ng-model="identityProvider.updateProfileFirstLogin" name="identityProvider.updateProfileFirstLogin" id="updateProfileFirstLogin" onoffswitch />
                        </div>
                        <span tooltip-placement="right" tooltip="Indicates if user must update his profile right after the first login." class="fa fa-info-circle"></span>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="authenticateByDefault">Authenticate By Default</label>
                        <div class="col-sm-4">
                            <input ng-model="identityProvider.authenticateByDefault" name="identityProvider.authenticateByDefault" id="authenticateByDefault" onoffswitch />
                        </div>
                        <span tooltip-placement="right" tooltip="Indicates if this provider should be tried by default for authentication even before displaying login screen" class="fa fa-info-circle"></span>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="guiOrder">GUI order</label>
                        <div class="col-sm-4">
                            <input class="form-control" id="guiOrder" type="text" ng-model="identityProvider.config.guiOrder">
                        </div>
                        <span tooltip-placement="right" tooltip="Number defining order of the provider in GUI (eg. on Login page)." class="fa fa-info-circle"></span>
                    </div>
                </fieldset>

                <div class="pull-right form-actions">
                    <button kc-save>Save</button>
                    <button kc-delete data-ng-click="remove()" data-ng-show="!newIdentityProvider">Delete</button>
                </div>
            </form>
        </div>
    </div>
</div>