ProfileScope.java 1.29 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  javax.servlet.http.HttpServletRequest
 *  org.apache.jackrabbit.api.security.user.User
 *  org.slf4j.Logger
 *  org.slf4j.LoggerFactory
 */
package com.adobe.granite.oauth.server.scopes.impl;

import com.adobe.granite.oauth.server.Scope;
import javax.servlet.http.HttpServletRequest;
import org.apache.jackrabbit.api.security.user.User;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ProfileScope
implements Scope {
    private static final Logger logger = LoggerFactory.getLogger(ProfileScope.class);
    public static final String PROFILE_API_URI = "/libs/oauth/profile";
    public static final String PROFILE_SCOPE_NAME = "profile";

    public String getResourcePath(User user) {
        try {
            return user.getPath() + "/profile";
        }
        catch (Exception e) {
            logger.error("OAuth System Exception ", (Throwable)e);
            throw new RuntimeException("OAuth System Exception");
        }
    }

    public String getEndpoint() {
        return "/libs/oauth/profile";
    }

    public String getName() {
        return "profile";
    }

    public String getDescription(HttpServletRequest request) {
        return "View basic information about your account";
    }
}