package com.skr.mdm.authentication.user.sms;

import org.springframework.security.authentication.AbstractAuthenticationToken;
import org.springframework.security.core.GrantedAuthority;

import java.util.Collection;

public class SmsAuthenticationToken extends AbstractAuthenticationToken {

    private static final long serialVersionUID = -3578288222289154241L;

    private final Object principal;
    private Object credentials;
    private final Object imei;
    private final Object oaid;
    private final Object uuid;
    private final Object companyId;

    public SmsAuthenticationToken(Object principal, Object credentials, Object imei, Object oaid, Object uuid,Object companyId) {
        super(null);
        this.principal = principal;
        this.credentials = credentials;
        this.imei = imei;
        this.oaid = oaid;
        this.uuid = uuid;
        this.companyId = companyId;
        setAuthenticated(false);
    }

    public SmsAuthenticationToken(Collection<? extends GrantedAuthority> authorities, Object principal, Object imei, Object oaid, Object uuid, Object companyId) {
        super(authorities);
        this.principal = principal;
        this.imei = imei;
        this.oaid = oaid;
        this.uuid = uuid;
        this.companyId = companyId;
        super.setAuthenticated(true);
    }

    @Override
    public Object getCredentials() {
        return this.credentials;
    }

    @Override
    public Object getPrincipal() {
        return this.principal;
    }

    @Override
    public void setAuthenticated(boolean isAuthenticated) throws IllegalArgumentException {
        super.setAuthenticated(isAuthenticated);
    }

    public Object getImei() {
        return this.imei;
    }
    public Object getOaid() {
        return oaid;
    }

    public Object getUuid() {
        return uuid;
    }

    public Object getCompanyId() {
        return companyId;
    }
}