Skip to content

Commit

Permalink
Merge pull request #21 from neondatabase/dsavelev/propagate-installat…
Browse files Browse the repository at this point in the history
…ion-id

Save Vercel installation ID for future use
  • Loading branch information
dsavelev authored Sep 26, 2024
2 parents 3818b3a + 7fb0ac4 commit ac1e1ac
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/main/java/vercel/VercelMPIdentityProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.fasterxml.jackson.annotation.JsonProperty;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.POST;
import jakarta.ws.rs.QueryParam;
import jakarta.ws.rs.core.HttpHeaders;
import jakarta.ws.rs.core.MediaType;
Expand Down Expand Up @@ -193,8 +192,6 @@ public Endpoint(RealmModel realm, AuthenticationCallback callback, EventBuilder
this.provider = provider;
}

// Override parent's authResponse and change annotation to @POST to be able to use @GET with another list of parameters
// and we need to initialize `authSession` properly.
@GET
@Override
public Response authResponse(@QueryParam(AbstractOAuth2IdentityProvider.OAUTH2_PARAMETER_STATE) String state,
Expand Down
23 changes: 23 additions & 0 deletions src/main/java/vercel/VercelMPUserAttributeMapper.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package vercel;

import org.keycloak.broker.oidc.mappers.UserAttributeMapper;

/**
* User attribute mapper.
*
*/
public class VercelMPUserAttributeMapper extends UserAttributeMapper {

private static final String[] cp = new String[] { VercelMPIdentityProviderFactory.PROVIDER_ID };

@Override
public String[] getCompatibleProviders() {
return cp;
}

@Override
public String getId() {
return "vercelmp-user-attribute-mapper";
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vercel.VercelMPUserAttributeMapper

0 comments on commit ac1e1ac

Please sign in to comment.