melodic-oil-50942
05/05/2024, 7:49 PMchilly-king-10285
05/05/2024, 7:49 PMchilly-king-10285
05/05/2024, 7:49 PMclient_secret_basicclient_secret_postclient_secret_basicAuthorization: basic ....client_secret_postContent-Type: application/x-www-form-urlencodedtoken_endpoint_auth_methodclient_secret_post--token-endpoint-auth-methodbash ory get oauth2-client {client.id}      {    // ...    "token_endpoint_auth_method": "client_secret_basic",    // ...   }"token_endpoint_auth_method": "client_secret_post"melodic-oil-50942
05/05/2024, 7:53 PMclient_secret_basicchilly-king-10285
05/05/2024, 7:53 PMchilly-king-10285
05/05/2024, 7:54 PMclient_secret_basicjavascript const clientID = "the-client-id"   const clientSecret = "the-secret-id"   const basicAuth = bas64_encode(url_encode(clientID) + ":" + url_encode(clientSecret))      const requestOptions = {    method: "POST",    headers: {    Authorization: "Basic " + basicAuth,    "Content-Type": "application/x-www-form-urlencoded",    },    body: "grant_type=authorization_code&code=your_authorization_code",   }      fetch("<https://your-project.projects.oryapis.com/oauth2/token>", requestOptions)    .then((response) => response.json())    .then((data) => console.log(data))"the-client-id""the-secret-id""your_authorization_code"authorization_codemelodic-oil-50942
05/05/2024, 7:55 PMchilly-king-10285
05/05/2024, 7:55 PMchilly-king-10285
05/05/2024, 7:55 PMbas64_encodeurl_encodebtoaencodeURIComponentjavascript const clientID = encodeURIComponent("the-client-id"); const clientSecret = encodeURIComponent("the-secret-id"); const basicAuth = btoa(clientID + ":" + clientSecret);  const requestOptions = {   method: "POST",   headers: {     Authorization: "Basic " + basicAuth,     "Content-Type": "application/x-www-form-urlencoded",   },   body: "grant_type=authorization_code&code=your_authorization_code", };  fetch("<https://your-project.projects.oryapis.com/oauth2/token>", requestOptions)   .then((response) => response.json())   .then((data) => console.log(data));encodeURIComponentbtoa"the-client-id""the-secret-id""your_authorization_code"melodic-oil-50942
05/05/2024, 7:58 PMchilly-king-10285
05/05/2024, 7:58 PMchilly-king-10285
05/05/2024, 7:58 PMbash ory get oauth2-client {client.id}}redirect_urismelodic-oil-50942
05/05/2024, 8:01 PMchilly-king-10285
05/05/2024, 8:01 PMchilly-king-10285
05/05/2024, 8:01 PMlogin_challengelogin_challenge/oauth2/auth/requests/login/acceptlogin_challengemelodic-oil-50942
05/05/2024, 8:08 PMchilly-king-10285
05/05/2024, 8:08 PMchilly-king-10285
05/05/2024, 8:08 PM<https://myapp.com/callback?code=AUTHORIZATION_CODE&state=12345>AUTHORIZATION_CODEstateURLSearchParamsjavascript const urlParams = new URLSearchParams(window.location.search); const authorizationCode = urlParams.get('code');window.location.search?urlParams.get('code')codemelodic-oil-50942
05/05/2024, 8:11 PMchilly-king-10285
05/05/2024, 8:11 PMchilly-king-10285
05/05/2024, 8:11 PM/oauth2/auth/requests/login/acceptlogin_challenge<https://domain/callback?code=AUTHORIZATION_CODE&state=xx>AUTHORIZATION_CODEredirect_urimelodic-oil-50942
05/05/2024, 8:14 PMacceptOAuth2LoginRequestmelodic-oil-50942
05/05/2024, 8:14 PMacceptOAuth2LoginRequestchilly-king-10285
05/05/2024, 8:14 PMchilly-king-10285
05/05/2024, 8:15 PMacceptOAuth2LoginRequestOAuth2Apilogin_verifier<https://domain/callback?code=AUTHORIZATION_CODE&state=xx>AUTHORIZATION_CODEmelodic-oil-50942
05/05/2024, 8:53 PMchilly-king-10285
05/05/2024, 8:53 PMchilly-king-10285
05/05/2024, 8:53 PM<https://domain/callback?code=AUTHORIZATION_CODE&state=xx>AUTHORIZATION_CODEURLSearchParamsjavascript const urlParams = new URLSearchParams(window.location.search); const authorizationCode = urlParams.get('code');window.location.search?urlParams.get('code')codemelodic-oil-50942
05/05/2024, 8:56 PMacceptOAuth2LoginRequestchilly-king-10285
05/05/2024, 8:56 PMchilly-king-10285
05/05/2024, 8:56 PMlogin_verifierlogin_verifieracceptOAuth2LoginRequest<https://domain/callback?code=AUTHORIZATION_CODE&state=xx>AUTHORIZATION_CODEURLSearchParamsjavascript const urlParams = new URLSearchParams(window.location.search); const authorizationCode = urlParams.get('code');window.location.search?urlParams.get('code')codemelodic-oil-50942
05/05/2024, 9:05 PMacceptOAuth2LoginRequestsparse-father-97864
05/05/2024, 9:34 PM/oauth/authorizecode/oauth/tokencodeclient_idclient_secretcoderedirect_urlClient authentication failed (e.g., unknown client, no client authentication included, or unsupported authentication method)client_idclient_secretacceptOAuth2LoginRequestmelodic-oil-50942
05/05/2024, 10:07 PMlogin_challangegetOAuth2LoginRequestlogin_challengeacceptOAuth2LoginRequestuserIdconst userId = data.identity.id;
    
    const { data: loginRequest } = await oryOAuth.getOAuth2LoginRequest({
      loginChallenge: challenge,
    });
if (loginRequest.client.skip_consent) {
      const { data } = await oryOAuth
        .acceptOAuth2LoginRequest({
          loginChallenge: challenge,
          acceptOAuth2LoginRequest: {
            subject: userId,
          },
        })        
        
        return NextResponse.json({ data }, { status: 200 });
    }/oauth/authorizesparse-father-97864
05/05/2024, 11:23 PM/oauth/authorize/oauth2/authoryOAuth.getOAuth2LoginRequest()sparse-father-97864
05/05/2024, 11:25 PMgetOAuth2LoginRequest()acceptOAuth2LoginRequest()challengeloginChallengesparse-father-97864
05/05/2024, 11:44 PMsparse-father-97864
05/05/2024, 11:47 PM<https://domain/oauth2/auth?client_id=xxxx&login_verifier=xx&redirect_uri=domain&response_type=code&scope=xx&state=xx>codelimited-photographer-61008
05/06/2024, 12:47 PMacceptOAuth2LoginRequest<https://domain/oauth2/auth?client_id=xxxx&login_verifier=xx&redirect_uri=domain&response_type=code&scope=xx&state=xx>codestatelimited-photographer-61008
05/06/2024, 12:53 PMmelodic-oil-50942
05/06/2024, 1:29 PM/challengelimited-photographer-61008
05/06/2024, 1:46 PMmelodic-oil-50942
05/06/2024, 1:54 PMmelodic-oil-50942
05/06/2024, 1:56 PMmelodic-oil-50942
05/06/2024, 2:00 PMmelodic-oil-50942
05/06/2024, 2:12 PMmelodic-oil-50942
05/06/2024, 2:18 PMreturn_urlacceptOAuth2LoginRequesthttp://localhost:3001/auth?consent_challenge=xxconsent_challengemelodic-oil-50942
05/06/2024, 2:25 PMmelodic-oil-50942
05/06/2024, 9:22 PMsparse-father-97864
05/06/2024, 9:23 PM