Refusing to share your identity is not a valid reason to determine that you are an illegal migrant. So they are not allowed to put you in immigration detention.