<div class="col-sm-9 col-md-10 col-sm-push-3 col-md-push-2" data-ng-init="initProvider()">
    <ol class="breadcrumb">
        <li><a href="#/realms/{{realm.realm}}/identity-provider-settings">Identity Providers</a></li>
        <li>{{identityProvider.alias}}</li>
    </ol>

    <h1 data-ng-hide="create"><strong>Identity Provider</strong> {{identityProvider.alias|capitalize}}</h1>
    <h1 data-ng-show="create"><strong>Add Social Identity Provider</strong></h1>

    <ul class="nav nav-tabs" data-ng-hide="newIdentityProvider">
        <li class="active"><a href="#/realms/{{realm.realm}}/identity-provider-settings/provider/{{identityProvider.providerId}}/{{identityProvider.alias}}">Settings</a></li>
        <li><a href="#/realms/{{realm.realm}}/identity-provider-mappers/{{identityProvider.alias}}/mappers">Mappers</a></li>
    </ul>

    <form class="form-horizontal" name="realmForm" novalidate>
        <fieldset>
            <div class="form-group clearfix">
                <label class="col-md-2 control-label" for="redirectUri">Redirect URI</label>
                <div class="col-sm-6">
                    <input class="form-control" id="redirectUri" type="text" value="{{callbackUrl}}{{identityProvider.alias}}/endpoint" readonly kc-select-action="click">
                </div>
                <kc-tooltip>The redirect uri to use when configuring the identity provider</kc-tooltip>
            </div>
        </fieldset>
        <fieldset>
            <div class="form-group clearfix">
                <label class="col-md-2 control-label" for="clientId"><span class="required">*</span> Client ID</label>
                <div class="col-md-6">
                    <input class="form-control" id="clientId" type="text" ng-model="identityProvider.config.clientId" required>
                </div>
                <kc-tooltip>The client identifier registered withing the identity provider.</kc-tooltip>
            </div>
            <div class="form-group clearfix">
                <label class="col-md-2 control-label" for="clientSecret"><span class="required">*</span> Client Secret</label>
                <div class="col-md-6">
                    <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>
                <kc-tooltip>The client secret registered withing the identity provider.</kc-tooltip>
            </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-md-2 control-label" for="defaultScope">Default Scopes </label>
                <div class="col-md-6">
                    <input class="form-control" id="defaultScope" type="text" ng-model="identityProvider.config.defaultScope">
                </div>
                <kc-tooltip>The scopes to be sent when asking for authorization. See documentation for possible values, separator and default value'.</kc-tooltip>
            </div>
            <div class="form-group">
                <label class="col-md-2 control-label" for="enabled">Store Tokens</label>
                <div class="col-md-6">
                    <input ng-model="identityProvider.storeToken" id="storeToken" onoffswitch />
                </div>
                <kc-tooltip>Enable/disable if tokens must be stored after authenticating users.</kc-tooltip>
            </div>
            <div class="form-group">
                <label class="col-md-2 control-label" for="storedTokensReadable">Stored Tokens Readable</label>
                <div class="col-md-6">
                    <input ng-model="identityProvider.addReadTokenRoleOnCreate" id="storedTokensReadable" onoffswitch />
                </div>
                <kc-tooltip>Enable/disable new users can read any stored tokens.  This assigns the broker.read-token role.</kc-tooltip>
            </div>
            <div class="form-group">
                <label class="col-md-2 control-label" for="enabled">Enabled</label>
                <div class="col-md-6">
                    <input ng-model="identityProvider.enabled" id="enabled" onoffswitch />
                </div>
                <kc-tooltip>Enable/disable this identity provider.</kc-tooltip>
            </div>
            <div class="form-group">
                <label class="col-md-2 control-label" for="updateProfileFirstLogin">Update Profile on First Login</label>
                <div class="col-md-6">
                    <input ng-model="identityProvider.updateProfileFirstLogin" name="identityProvider.updateProfileFirstLogin" id="updateProfileFirstLogin" onoffswitch />
                </div>
                <kc-tooltip>Indicates if user must update his profile right after the first login.</kc-tooltip>
            </div>
            <div class="form-group">
                <label class="col-md-2 control-label" for="authenticateByDefault">Authenticate By Default</label>
                <div class="col-md-6">
                    <input ng-model="identityProvider.authenticateByDefault" name="identityProvider.authenticateByDefault" id="authenticateByDefault" onoffswitch />
                </div>
                <kc-tooltip>Indicates if this provider should be tried by default for authentication even before displaying login screen</kc-tooltip>
            </div>
            <div class="form-group">
                <label class="col-md-2 control-label" for="guiOrder">GUI order</label>
                <div class="col-md-6">
                    <input class="form-control" id="guiOrder" type="text" ng-model="identityProvider.config.guiOrder">
                </div>
                <kc-tooltip>Number defining order of the provider in GUI (eg. on Login page).</kc-tooltip>
            </div>
        </fieldset>

        <div class="form-group">
            <div class="col-md-10 col-md-offset-2">
                <button kc-save data-ng-show="changed">Save</button>
                <button kc-cancel data-ng-click="cancel()" data-ng-show="changed">Cancel</button>
                <button kc-delete data-ng-click="remove()" data-ng-show="!newIdentityProvider">Delete</button>
            </div>
        </div>
    </form>
</div>

<kc-menu></kc-menu>