Skip to content
This repository was archived by the owner on Jan 20, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright (c) 2016 Network New Technologies Inc.
*
* Licensed 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 com.networknt.oauth.key.handler;

import com.hazelcast.core.IMap;
Expand All @@ -22,20 +38,22 @@


import java.io.IOException;
import java.net.URI;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicReference;

import static io.undertow.util.Headers.AUTHORIZATION;
import static io.undertow.util.Headers.BASIC;

/**
* Get certificate that is used to verify the particular kid passed as a parameter.
*
* @author Steve Hu
*/
public class Oauth2KeyKeyIdGetHandler extends AuditInfoHandler implements LightHttpHandler {
static final Logger logger = LoggerFactory.getLogger(Oauth2KeyKeyIdGetHandler.class);

Expand Down Expand Up @@ -164,7 +182,7 @@ private String getCertificateFromProvider(String providerId, String keyId) throw
String key = null;

if(provider != null) {
KeyRequest keyRequest = new KeyRequest();
KeyRequest keyRequest = new KeyRequest(keyId);
keyRequest.setServerUrl(provider.getServerUrl());
keyRequest.setUri(provider.getUri() + "/00" + keyId);
keyRequest.setEnableHttp2(true);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
/*
* Copyright (c) 2016 Network New Technologies Inc.
*
* Licensed 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 com.networknt.oauth.key.handler;

/**
* Configuration class for the key distribution service in light-oauth2
*
* @author Steve Hu
*/
public class OauthKeyConfig {
boolean enableAudit;

Expand Down