Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import org.w3c.dom.Document;

public class Main {
    public static String guessTokenFormat(Document document) {

        String minorVersion = document.getDocumentElement().getAttribute("MinorVersion");
        String majorVersion = document.getDocumentElement().getAttribute("MajorVersion");
        String version = document.getDocumentElement().getAttribute("Version");

        if ("1".equals(majorVersion) && "1".equals(minorVersion)) {

            return "SAML 1.1";
        } else if ("2.0".equals(version)) {

            return "SAML 2.0";
        } else {

            return null;
        }
    }
}