3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell/*
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * The contents of this file are subject to the terms of the Common Development and
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * Distribution License (the License). You may not use this file except in compliance with the
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * License.
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell *
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * specific language governing permission and limitations under the License.
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell *
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * When distributing Covered Software, include this CDDL Header Notice in each file and include
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * Header, with the fields enclosed by brackets [] replaced by your own identifying
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * information: "Portions copyright [year] [name of copyright owner]".
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell *
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * Copyright 2014 ForgeRock AS.
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell */
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnellpackage com.sun.identity.console.task.model;
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnellimport com.sun.identity.console.base.model.AMConsoleException;
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnellimport com.sun.identity.console.base.model.AMModel;
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnellimport java.util.SortedSet;
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell/**
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * Model class for common tasks involved in configuring social authentication providers (Google, Facebook etc).
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell *
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * @since 12.0.0
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell */
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnellpublic interface SocialAuthNModel extends AMModel {
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell /**
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * Get a set of all configured realms, sorted lexicographically.
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell *
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * @return the set of all realms.
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell */
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell SortedSet<String> getRealms() throws AMConsoleException;
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell /**
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * The default URL to use for the OAuth2 redirect proxy. This makes a best-effort guess based on the server
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * configuration, but the user may have to override it to account for load balancers etc.
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * @return The default redirect URL.
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell */
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell String getDefaultRedirectUrl();
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell /**
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * Indicates whether the provider has known settings or not. This controls whether we display additional fields.
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell *
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * @return true if this is a known social authn provider or false if manual config is required.
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell */
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell boolean isKnownProvider();
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell /**
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * Get the name of this social authn provider suitable for display to a user.
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell *
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * @return the (possibly localized) name of the authn provider.
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell */
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell String getProviderDisplayName();
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell /**
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * A localized message describing how to register with this particular social authentication provider. This is
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * localized per provider to allow more detailed help messages to be given. If the provider is not known then this
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * method returns null and some default message should be used.
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell *
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * @return a localized help message for the provider, or {@code null} if provider unknown.
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell */
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell String getLocalizedProviderHelpMessage();
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell}