Skip to content

Instantly share code, notes, and snippets.

@mefarazath
mefarazath / CreateSecret.java
Created January 10, 2023 06:27
Create Apple Client Secret
import com.nimbusds.jose.*;
import com.nimbusds.jose.crypto.*;
import com.nimbusds.jose.jwk.*;
import com.nimbusds.jwt.*;
import java.io.*;
import java.security.*;
import java.security.spec.*;
import java.time.*;
import java.util.*;
<!DOCTYPE html\n PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n <html xmlns=\"http://www.w3.org/1999/xhtml\">\n\n <head>\n
<meta content=\"text/html; charset=utf-8\" http-equiv=\"Content-Type\" />\n
<!-- Facebook sharing information tags -->\n\n <title>Login from a new device</title>\n\n
<!-- [if mso]>\n
<style type=\"text/css\">\n @import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900');\n\n @font-face {\n font-family: 'Montserrat', ;\n font-style: normal;\n font-weight: 400;\n src: local('Montserrat'),\n local('Montserrat'),\n url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100;0,200;0,
ID: [34] [] [2020-04-30 20:40:16,998] [418a1b87-89e3-419b-8ef6-ecbc81a3cb76] ERROR {org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/api/users/v2/me/webauthn].[CXFServlet]} - Servlet.service() for servlet [CXFServlet] threw exception org.apache.cxf.interceptor.Fault: Could not initialize class com.yubico.webauthn.AndroidSafetynetAttestationStatementVerifier
at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:162)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:128)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:193)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:103)
<?xml version="1.0" encoding="UTF-8"?><ServiceProvider>
<ApplicationName>apple-sign-in-app</ApplicationName>
<Description/>
<InboundAuthenticationConfig>
<InboundAuthenticationRequestConfigs>
<InboundAuthenticationRequestConfig>
<InboundAuthKey>pAlTjf4hEdBsxtIjaeZBnoBQRzoa</InboundAuthKey>
<InboundAuthType>oauth2</InboundAuthType>
<InboundConfigType>standardAPP</InboundConfigType>
<inboundConfiguration><![CDATA[<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
require 'jwt'
# Your private key from Apple
key_file = 'key.txt'
# Your 10-character Team ID
team_id = ''
# Your Services ID, e.g. idp.applesignintest.com
client_id = ''
# 10-char Key ID value from the Keys section
key_id = ''
{"keys":[{"kty":"RSA","e":"AQAB","use":"sig","kid":"NTAxZmMxNDMyZDg3MTU1ZGM0MzEzODJhZWI4NDNlZDU1OGFkNjFiMQ","alg":"RS256","n":"luZFdW1ynitztkWLC6xKegbRWxky-5P0p4ShYEOkHs30QI2VCuR6Qo4Bz5rTgLBrky03W1GAVrZxuvKRGj9V9-PmjdGtau4CTXu9pLLcqnruaczoSdvBYA3lS9a7zgFU0-s6kMl2EhB-rk7gXluEep7lIOenzfl2f6IoTKa2fVgVd3YKiSGsyL4tztS70vmmX121qm0sTJdKWP4HxXyqK9neolXI9fYyHOYILVNZ69z_73OOVhkh_mvTmWZLM7GM6sApmyLX6OXUp8z0pkY-vT_9-zRxxQs7GurC4_C1nK3rI_0ySUgGEafO1atNjYmlFN-M3tZX6nEcA6g94IavyQ"}]}
[2018-08-29 11:18:51,363] ERROR {org.wso2.carbon.identity.sso.saml.servlet.SAMLSSOProviderServlet} - Error when processing the authentication request!
org.wso2.carbon.identity.base.IdentityException: Error while reading service provider configurations for issuer : https://mrclemrkz-dev-ed.my.salesforce.com in tenant domain : carbon.super
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.wso2.carbon.identity.base.IdentityException.error(IdentityException.java:91)
at org.wso2.carbon.identity.sso.saml.servlet.SAMLSSOProviderServlet.getServiceProviderConfig(SAMLSSOProviderServlet.java:1339)
at org.wso2.carbon.identity.sso.saml.servlet.SAMLSSOProviderServlet.handleAuthenticationReponseFromFramework(SAMLSSOProviderS
TID: [-1234] [] [2018-05-16 09:09:34,602] ERROR {org.wso2.carbon.identity.application.authentication.framework.handler.request.impl.DefaultRequestCoordinator} - Exception in Authentication Framework
java.lang.NullPointerException
at org.wso2.carbon.identity.application.authentication.framework.handler.claims.impl.DefaultClaimHandler.handleLocalClaims(DefaultClaimHandler.java:368)
at org.wso2.carbon.identity.application.authentication.framework.handler.claims.impl.DefaultClaimHandler.handleClaimMappings(DefaultClaimHandler.java:97)
at org.wso2.carbon.identity.application.authentication.framework.handler.sequence.impl.DefaultRequestPathBasedSequenceHandler.handleClaimMappings(DefaultRequestPathBasedSequenceHandler.java:315)
at org.wso2.carbon.identity.application.authentication.framework.handler.sequence.impl.DefaultRequestPathBasedSequenceHandler.handlePostAuthentication(DefaultRequestPathBasedSequenceHandler.java:180)
at org.wso2.carbon.identity.application.authentication.framework.handler.sequence.imp
JAVA_HOME environment variable is set to /home/farazath/DevTools/jdk1.8.0_144
CARBON_HOME environment variable is set to /home/farazath/CBSA/playground/wso2is-km-5.3.0
Using Java memory options: -Xms256m -Xmx1024m
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.wso2.carbon.bootstrap.Bootstrap.loadClass(Bootstrap.java:69)
at org.wso2.carbon.bootstrap.Bootstrap.main(Bootstrap.java:50)
[2018-05-02 18:28:01,562] ERROR - APIAuthenticationHandler API authentication failure due to Unclassified Authentication Failure
org.wso2.carbon.apimgt.gateway.handlers.security.APISecurityException: Error while accessing backend services for API key validation
at org.wso2.carbon.apimgt.gateway.handlers.security.keys.WSAPIKeyDataStore.getAllURITemplates(WSAPIKeyDataStore.java:77)
at org.wso2.carbon.apimgt.gateway.handlers.security.APIKeyValidator.getAllURITemplates(APIKeyValidator.java:772)
at org.wso2.carbon.apimgt.gateway.handlers.security.APIKeyValidator.doGetAPIInfo(APIKeyValidator.java:626)
at org.wso2.carbon.apimgt.gateway.handlers.security.APIKeyValidator.findMatchingVerb(APIKeyValidator.java:566)
at org.wso2.carbon.apimgt.gateway.handlers.security.APIKeyValidator.getResourceAuthenticationScheme(APIKeyValidator.java:359)
at org.wso2.carbon.apimgt.gateway.handlers.security.oauth.OAuthAuthenticator.authenticate(OAuthAuthenticator.java:119)
at org.wso2.carbon.apimgt.gateway.handlers.security.APIAut