导航菜单

页面标题

页面副标题

St.John's v1.0.9 - NativeAuthOAuth2Configuration.java 源代码

正在查看: St.John's v1.0.9 应用的 NativeAuthOAuth2Configuration.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.microsoft.identity.common.java.nativeauth.providers;

import com.microsoft.identity.common.java.logging.LogSession;
import com.microsoft.identity.common.java.logging.Logger;
import com.microsoft.identity.common.java.nativeauth.BuildValues;
import com.microsoft.identity.common.java.providers.microsoft.microsoftsts.MicrosoftStsOAuth2Configuration;
import com.microsoft.identity.common.java.util.UrlUtil;
import io.ably.lib.realtime.Presence;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.net.URL;
import kotlin.Metadata;
import kotlin.jvm.internal.Intrinsics;

@Metadata(d1 = {"\u0000 \n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0019\u0018\u0000  2\u00020\u0001:\u0001 B'\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0005\u0012\u0006\u0010\u0006\u001a\u00020\u0005\u0012\b\b\u0002\u0010\u0007\u001a\u00020\b¢\u0006\u0002\u0010\tJ\b\u0010\u0011\u001a\u00020\u0003H\u0016J\u0018\u0010\u0012\u001a\u00020\u00032\u0006\u0010\u0013\u001a\u00020\u00032\u0006\u0010\u0014\u001a\u00020\u0005H\u0002J\u0006\u0010\u0015\u001a\u00020\u0003J\u0006\u0010\u0016\u001a\u00020\u0003J\u0006\u0010\u0017\u001a\u00020\u0003J\u0006\u0010\u0018\u001a\u00020\u0003J\u0006\u0010\u0019\u001a\u00020\u0003J\u0006\u0010\u001a\u001a\u00020\u0003J\u0006\u0010\u001b\u001a\u00020\u0003J\u0006\u0010\u001c\u001a\u00020\u0003J\u0006\u0010\u001d\u001a\u00020\u0003J\u0006\u0010\u001e\u001a\u00020\u0003J\u0006\u0010\u001f\u001a\u00020\u0003R\u0016\u0010\n\u001a\n \u000b*\u0004\u0018\u00010\u00050\u0005X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004¢\u0006\u0002\n\u0000R\u0011\u0010\u0006\u001a\u00020\u0005¢\u0006\b\n\u0000\u001a\u0004\b\f\u0010\rR\u0011\u0010\u0004\u001a\u00020\u0005¢\u0006\b\n\u0000\u001a\u0004\b\u000e\u0010\rR\u0011\u0010\u0007\u001a\u00020\b¢\u0006\b\n\u0000\u001a\u0004\b\u000f\u0010\u0010¨\u0006!"}, d2 = {"Lcom/microsoft/identity/common/java/nativeauth/providers/NativeAuthOAuth2Configuration;", "Lcom/microsoft/identity/common/java/providers/microsoft/microsoftsts/MicrosoftStsOAuth2Configuration;", "authorityUrl", "Ljava/net/URL;", Presence.GET_CLIENTID, "", "challengeType", "useMockApiForNativeAuth", "", "(Ljava/net/URL;Ljava/lang/String;Ljava/lang/String;Z)V", "TAG", "kotlin.jvm.PlatformType", "getChallengeType", "()Ljava/lang/String;", "getClientId", "getUseMockApiForNativeAuth", "()Z", "getAuthorityUrl", "getEndpointUrlFromRootAndTenantAndSuffix", "root", "endpointSuffix", "getResetPasswordChallengeEndpoint", "getResetPasswordContinueEndpoint", "getResetPasswordPollCompletionEndpoint", "getResetPasswordStartEndpoint", "getResetPasswordSubmitEndpoint", "getSignInChallengeEndpoint", "getSignInInitiateEndpoint", "getSignInTokenEndpoint", "getSignUpChallengeEndpoint", "getSignUpContinueEndpoint", "getSignUpStartEndpoint", "Companion", "common4j"}, k = 1, mv = {1, 7, 1}, xi = 48)
public final class NativeAuthOAuth2Configuration extends MicrosoftStsOAuth2Configuration {
    private static final String MOCK_API_URL_WITH_NATIVE_AUTH_TENANT = "https://native-ux-mock-api.azurewebsites.net/lumonconvergedps.onmicrosoft.com";
    private static final String RESET_PASSWORD_CHALLENGE_ENDPOINT_SUFFIX = "/resetpassword/v1.0/challenge";
    private static final String RESET_PASSWORD_COMPLETE_ENDPOINT_SUFFIX = "/resetpassword/v1.0/poll_completion";
    private static final String RESET_PASSWORD_CONTINUE_ENDPOINT_SUFFIX = "/resetpassword/v1.0/continue";
    private static final String RESET_PASSWORD_START_ENDPOINT_SUFFIX = "/resetpassword/v1.0/start";
    private static final String RESET_PASSWORD_SUBMIT_ENDPOINT_SUFFIX = "/resetpassword/v1.0/submit";
    private static final String SIGNUP_CHALLENGE_ENDPOINT_SUFFIX = "/signup/v1.0/challenge";
    private static final String SIGNUP_CONTINUE_ENDPOINT_SUFFIX = "/signup/v1.0/continue";
    private static final String SIGNUP_START_ENDPOINT_SUFFIX = "/signup/v1.0/start";
    private static final String SIGN_IN_CHALLENGE_ENDPOINT_SUFFIX = "/oauth2/v2.0/challenge";
    private static final String SIGN_IN_INITIATE_ENDPOINT_SUFFIX = "/oauth2/v2.0/initiate";
    private static final String SIGN_IN_TOKEN_ENDPOINT_SUFFIX = "/oauth2/v2.0/token";
    private final String TAG;
    private final URL authorityUrl;
    private final String challengeType;
    private final String clientId;
    private final boolean useMockApiForNativeAuth;

    public final String getClientId() {
        return this.clientId;
    }

    public final String getChallengeType() {
        return this.challengeType;
    }

    public NativeAuthOAuth2Configuration(java.net.URL r1, java.lang.String r2, java.lang.String r3, boolean r4, int r5, kotlin.jvm.internal.DefaultConstructorMarker r6) {
        throw new UnsupportedOperationException("Method not decompiled: com.microsoft.identity.common.java.nativeauth.providers.NativeAuthOAuth2Configuration.<init>(java.net.URL, java.lang.String, java.lang.String, boolean, int, kotlin.jvm.internal.DefaultConstructorMarker):void");
    }

    public final boolean getUseMockApiForNativeAuth() {
        return this.useMockApiForNativeAuth;
    }

    public NativeAuthOAuth2Configuration(URL authorityUrl, String clientId, String challengeType, boolean z) {
        Intrinsics.checkNotNullParameter(authorityUrl, "authorityUrl");
        Intrinsics.checkNotNullParameter(clientId, "clientId");
        Intrinsics.checkNotNullParameter(challengeType, "challengeType");
        this.authorityUrl = authorityUrl;
        this.clientId = clientId;
        this.challengeType = challengeType;
        this.useMockApiForNativeAuth = z;
        this.TAG = "NativeAuthOAuth2Configuration";
    }

    @Override
    public URL getAuthorityUrl() {
        if (this.useMockApiForNativeAuth) {
            return new URL(MOCK_API_URL_WITH_NATIVE_AUTH_TENANT);
        }
        return this.authorityUrl;
    }

    public final URL getSignUpStartEndpoint() {
        LogSession.Companion companion = LogSession.INSTANCE;
        String TAG = this.TAG;
        Intrinsics.checkNotNullExpressionValue(TAG, "TAG");
        companion.logMethodCall(TAG, this.TAG + ".getSignUpStartEndpoint");
        return getEndpointUrlFromRootAndTenantAndSuffix(getAuthorityUrl(), SIGNUP_START_ENDPOINT_SUFFIX);
    }

    public final URL getSignUpChallengeEndpoint() {
        LogSession.Companion companion = LogSession.INSTANCE;
        String TAG = this.TAG;
        Intrinsics.checkNotNullExpressionValue(TAG, "TAG");
        companion.logMethodCall(TAG, this.TAG + ".getSignUpChallengeEndpoint");
        return getEndpointUrlFromRootAndTenantAndSuffix(getAuthorityUrl(), SIGNUP_CHALLENGE_ENDPOINT_SUFFIX);
    }

    public final URL getSignUpContinueEndpoint() {
        LogSession.Companion companion = LogSession.INSTANCE;
        String TAG = this.TAG;
        Intrinsics.checkNotNullExpressionValue(TAG, "TAG");
        companion.logMethodCall(TAG, this.TAG + ".getSignUpContinueEndpoint");
        return getEndpointUrlFromRootAndTenantAndSuffix(getAuthorityUrl(), SIGNUP_CONTINUE_ENDPOINT_SUFFIX);
    }

    public final URL getResetPasswordStartEndpoint() {
        LogSession.Companion companion = LogSession.INSTANCE;
        String TAG = this.TAG;
        Intrinsics.checkNotNullExpressionValue(TAG, "TAG");
        companion.logMethodCall(TAG, this.TAG + ".getResetPasswordStartEndpoint");
        return getEndpointUrlFromRootAndTenantAndSuffix(getAuthorityUrl(), RESET_PASSWORD_START_ENDPOINT_SUFFIX);
    }

    public final URL getResetPasswordChallengeEndpoint() {
        LogSession.Companion companion = LogSession.INSTANCE;
        String TAG = this.TAG;
        Intrinsics.checkNotNullExpressionValue(TAG, "TAG");
        companion.logMethodCall(TAG, this.TAG + ".getResetPasswordChallengeEndpoint");
        return getEndpointUrlFromRootAndTenantAndSuffix(getAuthorityUrl(), RESET_PASSWORD_CHALLENGE_ENDPOINT_SUFFIX);
    }

    public final URL getResetPasswordContinueEndpoint() {
        LogSession.Companion companion = LogSession.INSTANCE;
        String TAG = this.TAG;
        Intrinsics.checkNotNullExpressionValue(TAG, "TAG");
        companion.logMethodCall(TAG, this.TAG + ".getResetPasswordContinueEndpoint");
        return getEndpointUrlFromRootAndTenantAndSuffix(getAuthorityUrl(), RESET_PASSWORD_CONTINUE_ENDPOINT_SUFFIX);
    }

    public final URL getResetPasswordSubmitEndpoint() {
        LogSession.Companion companion = LogSession.INSTANCE;
        String TAG = this.TAG;
        Intrinsics.checkNotNullExpressionValue(TAG, "TAG");
        companion.logMethodCall(TAG, this.TAG + ".getResetPasswordSubmitEndpoint");
        return getEndpointUrlFromRootAndTenantAndSuffix(getAuthorityUrl(), RESET_PASSWORD_SUBMIT_ENDPOINT_SUFFIX);
    }

    public final URL getResetPasswordPollCompletionEndpoint() {
        LogSession.Companion companion = LogSession.INSTANCE;
        String TAG = this.TAG;
        Intrinsics.checkNotNullExpressionValue(TAG, "TAG");
        companion.logMethodCall(TAG, this.TAG + ".getResetPasswordPollCompletionEndpoint");
        return getEndpointUrlFromRootAndTenantAndSuffix(getAuthorityUrl(), RESET_PASSWORD_COMPLETE_ENDPOINT_SUFFIX);
    }

    public final URL getSignInInitiateEndpoint() {
        LogSession.Companion companion = LogSession.INSTANCE;
        String TAG = this.TAG;
        Intrinsics.checkNotNullExpressionValue(TAG, "TAG");
        companion.logMethodCall(TAG, this.TAG + ".getSignInInitiateEndpoint");
        return getEndpointUrlFromRootAndTenantAndSuffix(getAuthorityUrl(), SIGN_IN_INITIATE_ENDPOINT_SUFFIX);
    }

    public final URL getSignInChallengeEndpoint() {
        LogSession.Companion companion = LogSession.INSTANCE;
        String TAG = this.TAG;
        Intrinsics.checkNotNullExpressionValue(TAG, "TAG");
        companion.logMethodCall(TAG, this.TAG + ".getSignInChallengeEndpoint");
        return getEndpointUrlFromRootAndTenantAndSuffix(getAuthorityUrl(), SIGN_IN_CHALLENGE_ENDPOINT_SUFFIX);
    }

    public final URL getSignInTokenEndpoint() {
        LogSession.Companion companion = LogSession.INSTANCE;
        String TAG = this.TAG;
        Intrinsics.checkNotNullExpressionValue(TAG, "TAG");
        companion.logMethodCall(TAG, this.TAG + ".getSignInTokenEndpoint");
        return getEndpointUrlFromRootAndTenantAndSuffix(getAuthorityUrl(), SIGN_IN_TOKEN_ENDPOINT_SUFFIX);
    }

    private final URL getEndpointUrlFromRootAndTenantAndSuffix(URL root, String endpointSuffix) {
        URL appendPathToURL;
        LogSession.Companion companion = LogSession.INSTANCE;
        String TAG = this.TAG;
        Intrinsics.checkNotNullExpressionValue(TAG, "TAG");
        companion.logMethodCall(TAG, this.TAG + ".getEndpointUrlFromRootAndTenantAndSuffix");
        try {
            String dc = BuildValues.getDC();
            Intrinsics.checkNotNullExpressionValue(dc, "getDC()");
            if (dc.length() > 0) {
                appendPathToURL = UrlUtil.appendPathAndQueryToURL(root, endpointSuffix, "dc=" + BuildValues.getDC());
            } else {
                appendPathToURL = UrlUtil.appendPathToURL(root, endpointSuffix);
            }
            Intrinsics.checkNotNullExpressionValue(appendPathToURL, "{\n            if (BuildV…)\n            }\n        }");
            return appendPathToURL;
        } catch (MalformedURLException e) {
            Logger.error(this.TAG, "appendPathToURL failed", e);
            throw e;
        } catch (URISyntaxException e2) {
            Logger.error(this.TAG, "appendPathToURL failed", e2);
            throw e2;
        }
    }
}