harikrishna-patnala commented on code in PR #7996: URL: https://github.com/apache/cloudstack/pull/7996#discussion_r1340938635
########## plugins/user-authenticators/oauth2/src/main/java/org/apache/cloudstack/oauth2/google/GoogleOAuth2Utils.java: ########## @@ -0,0 +1,97 @@ +// +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +// +package org.apache.cloudstack.oauth2.google; + +import com.cloud.utils.PropertiesUtil; +import com.cloud.utils.server.ServerProperties; +import com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeFlow; +import com.google.api.client.googleapis.auth.oauth2.GoogleIdToken; +import com.google.api.client.googleapis.auth.oauth2.GoogleIdTokenVerifier; +import com.google.api.client.http.HttpTransport; +import com.google.api.client.http.javanet.NetHttpTransport; +import com.google.api.client.json.gson.GsonFactory; +import com.google.api.client.json.jackson2.JacksonFactory; +import com.google.api.client.util.store.MemoryDataStoreFactory; +import org.apache.log4j.Logger; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.security.GeneralSecurityException; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Properties; + +public class GoogleOAuth2Utils { + + private static final Logger s_logger = Logger.getLogger(GoogleOAuth2Utils.class); + + private static final HttpTransport HTTP_TRANSPORT = new NetHttpTransport(); + + public static GoogleAuthorizationCodeFlow newFlow() throws IOException { + String oauthClientId = null; + String oauthClientSecret = null; + + final File confFile = PropertiesUtil.findConfigFile("server.properties"); + + s_logger.info("Server configuration file found: " + confFile.getAbsolutePath()); + + try { + InputStream is = new FileInputStream(confFile); + final Properties properties = ServerProperties.getServerProperties(is); + + oauthClientId = "345798102268-cfcpg40k6hnfft2m61mf6jbmjcfg4p82.apps.googleusercontent.com"; + oauthClientSecret = "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"; + } catch (final IOException e) { + } Review Comment: This is an unused class, removed the file. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@cloudstack.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org