Skip to content

Instantly share code, notes, and snippets.

@ceelsoin
Created July 20, 2021 02:40
Show Gist options
  • Save ceelsoin/e82e93bf4a3f1b446f0e74904f33d868 to your computer and use it in GitHub Desktop.
Save ceelsoin/e82e93bf4a3f1b446f0e74904f33d868 to your computer and use it in GitHub Desktop.
public async getKeycloakUserByEmail(email: String): Promise<any> {
const config = {
headers: {
Authorization: 'Bearer '+ await this.getApplicationServiceToken(),
}
};
return axios.get(`${this.BASE_URL}/auth/admin/realms/shallwe/users?email=${email}`, config)
}
public async updatePassword(password: String, keycloakUserId: String): Promise<any>{
const config = {
headers: {
'authorization': 'Bearer '+ await this.getApplicationServiceToken(),
'content-type': 'application/json'
}
}
const payload = {
type: "password",
value: password,
temporary: false
}
return axios.put(`${this.BASE_URL}/auth/admin/realms/shallwe/users/${keycloakUserId}/reset-password`, payload, config)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment