Skip to content

Instantly share code, notes, and snippets.

View balvinder294's full-sized avatar
😎
Working Remotey

Balvinder Singh balvinder294

😎
Working Remotey
View GitHub Profile
package xyz;
public class ZoomMeetingTrackingFieldsDTO {
public String field;
public String value;
public Boolean visible;
public String getField() {
package dehaze.mvp.service.dto.zoom;
import java.io.Serializable;
import java.util.List;
public class ZoomMeetingObjectDTO implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
package xyz;
import java.io.Serializable;
import java.util.List;
public class ZoomMeetingsListResponseDTO implements Serializable {
private static final long serialVersionUID = -218290644483495371L;
private Integer page_size;
@balvinder294
balvinder294 / do-authorization.ts
Created January 15, 2021 08:10
Sample method to do social media login authorization in popup window and get credentials from url
doAuthorization(url: string, socialMediaProvider: string, isRegisterAction: boolean) {
/* isRegisterAction flag i am using to check if the process is for registration or Login */
/* socialMediaProvider is for name of social media , it is optional*/
let loopCount = this.loopCount;
/* Create the window object by passing url and optional window title */
this.windowHandle = this.createOauthWindow(authorizationUrl, 'OAuth login');
@balvinder294
balvinder294 / app-role.directive.ts
Created September 7, 2020 07:49
Role based component Display in Angular with directive
import { Component } from '@angular/core';
import { Directive, Input, TemplateRef, ViewContainerRef, OnDestroy } from '@angular/core';
import { Subscription } from 'rxjs';
/**
* @whatItDoes Conditionally includes an HTML element if current user has any
* of the roles passed as the `expression`.
*
* @howToUse
* ```
@balvinder294
balvinder294 / SocialRedirect.java
Created July 27, 2020 08:21
Methods to handle social redirect when using popup for authorization with Apple SignIn with response type as form-post for a subdomain
/**
* Redirect User to Social verify to complete social media authorization
*
* @param state the state parameter containing BoxDomain for verification
* @param code the authorization code
* @param httpServletResponse the response with redirection for url
*
* @throws IOException
*/
@GetMapping(value = "/social-login/authorize")
@balvinder294
balvinder294 / AuthorizationUrl.java
Last active July 27, 2020 08:21
Method to create Authorization Url for Apple Sign in Auhtorization for a user
import org.json.JSONObject;
/******
*To create authorization url for social sign in
this url will open authentication window for apple sign in
for a subdomain as state param
*****/
public String createAuthorizationUrl(String subDomain) {
// I have added jsob objct for encodin state paramters like for getting the curent domain used as we have multiple subdomains, you can add your state parameters here
JSONObject jsonObject = new JSONObject();
@balvinder294
balvinder294 / SocialParametersDTO.java
Created July 27, 2020 07:44
DTO for handling Authorization parameters for sending to api for Social Sign in from Apple SignIn
package dehaze.mvp.service.dto;
import java.io.Serializable;
/**
* A DTO for the SocialUser.
*/
public class SocialParametersDTO implements Serializable {
private static final long serialVersionUID = 3484800209656475818L;
@balvinder294
balvinder294 / ListApplePublicKey.java
Created July 27, 2020 07:33
DTO for handling Response from Apples public key list for Apple Sign In
import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
public final class ListApplePublicKey {
private final List<ApplePublicKey> keys;
public ListApplePublicKey(@JsonProperty("keys") List<ApplePublicKey> keys) {
this.keys = keys;
@balvinder294
balvinder294 / TokenResponse.java
Created July 27, 2020 07:32
DTO for handling response For OAuth Token from Apple SignIn
public final class TokenResponse {
private String access_token;
private String token_type;
private Long expires_in;
private String refresh_token;
private String id_token;
public String getAccess_token() {
return access_token;